Mercurial > ~mikael > mcabber > hg
diff mcabber/mcabber/xmpp_iq.c @ 1701:44e023ad99ed
Add dummy handler for roster manipulation IQ responses
This clears up the "Unhandled IQ" messages, only errors should displayed now.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 07 Feb 2010 19:13:33 +0100 |
parents | 41c26b7d2890 |
children | e6e89b1d7831 |
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp_iq.c Sun Feb 07 17:34:00 2010 +0100 +++ b/mcabber/mcabber/xmpp_iq.c Sun Feb 07 19:13:33 2010 +0100 @@ -144,6 +144,17 @@ lm_message_node_add_child(field, "value", message); } +// Dummy handler to ignore IQ response +LmHandlerResult handle_iq_dummy(LmMessageHandler *h, LmConnection *c, + LmMessage *m, gpointer ud) +{ + LmMessageSubType mstype = lm_message_get_sub_type(m); + if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { + display_server_error(lm_message_node_get_child(m->node, "error")); + } + return LM_HANDLER_RESULT_REMOVE_MESSAGE; +} + static LmHandlerResult handle_iq_commands_list(LmMessageHandler *h, LmConnection *c, LmMessage *m, gpointer ud) @@ -560,11 +571,9 @@ int need_refresh = FALSE; guint roster_type; - for (y = lm_message_node_find_child(lm_message_node_find_xmlns - (m->node, NS_ROSTER), - "item"); - y; - y = y->next) { + y = lm_message_node_find_child(lm_message_node_find_xmlns(m->node, NS_ROSTER), + "item"); + for ( ; y; y = y->next) { char *name_tmp = NULL; fjid = lm_message_node_get_attribute(y, "jid");