Mercurial > ~mikael > mcabber > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1700:87dd0a8f1a9c | 1701:44e023ad99ed |
---|---|
140 lm_message_node_set_attributes(field, | 140 lm_message_node_set_attributes(field, |
141 "type", "text-single", | 141 "type", "text-single", |
142 "var", "message", | 142 "var", "message", |
143 NULL); | 143 NULL); |
144 lm_message_node_add_child(field, "value", message); | 144 lm_message_node_add_child(field, "value", message); |
145 } | |
146 | |
147 // Dummy handler to ignore IQ response | |
148 LmHandlerResult handle_iq_dummy(LmMessageHandler *h, LmConnection *c, | |
149 LmMessage *m, gpointer ud) | |
150 { | |
151 LmMessageSubType mstype = lm_message_get_sub_type(m); | |
152 if (mstype == LM_MESSAGE_SUB_TYPE_ERROR) { | |
153 display_server_error(lm_message_node_get_child(m->node, "error")); | |
154 } | |
155 return LM_HANDLER_RESULT_REMOVE_MESSAGE; | |
145 } | 156 } |
146 | 157 |
147 static LmHandlerResult handle_iq_commands_list(LmMessageHandler *h, | 158 static LmHandlerResult handle_iq_commands_list(LmMessageHandler *h, |
148 LmConnection *c, | 159 LmConnection *c, |
149 LmMessage *m, gpointer ud) | 160 LmMessage *m, gpointer ud) |
558 char *cleanalias; | 569 char *cleanalias; |
559 enum subscr esub; | 570 enum subscr esub; |
560 int need_refresh = FALSE; | 571 int need_refresh = FALSE; |
561 guint roster_type; | 572 guint roster_type; |
562 | 573 |
563 for (y = lm_message_node_find_child(lm_message_node_find_xmlns | 574 y = lm_message_node_find_child(lm_message_node_find_xmlns(m->node, NS_ROSTER), |
564 (m->node, NS_ROSTER), | 575 "item"); |
565 "item"); | 576 for ( ; y; y = y->next) { |
566 y; | |
567 y = y->next) { | |
568 char *name_tmp = NULL; | 577 char *name_tmp = NULL; |
569 | 578 |
570 fjid = lm_message_node_get_attribute(y, "jid"); | 579 fjid = lm_message_node_get_attribute(y, "jid"); |
571 name = lm_message_node_get_attribute(y, "name"); | 580 name = lm_message_node_get_attribute(y, "name"); |
572 sub = lm_message_node_get_attribute(y, "subscription"); | 581 sub = lm_message_node_get_attribute(y, "subscription"); |