Mercurial > ~mikael > mcabber > hg
comparison mcabber/mcabber/xmpp.c @ 1994:024bdd1c6418
Add a dummy handler for some unhandled IQ replies
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Wed, 30 Mar 2011 22:02:48 +0200 |
parents | b0470ef8669b |
children | 41667bc02883 |
comparison
equal
deleted
inserted
replaced
1993:d4273346d52d | 1994:024bdd1c6418 |
---|---|
196 iq = lm_message_new_with_sub_type(cleanjid, LM_MESSAGE_TYPE_IQ, | 196 iq = lm_message_new_with_sub_type(cleanjid, LM_MESSAGE_TYPE_IQ, |
197 LM_MESSAGE_SUB_TYPE_SET); | 197 LM_MESSAGE_SUB_TYPE_SET); |
198 y = lm_message_node_add_child(iq->node, "query", NULL); | 198 y = lm_message_node_add_child(iq->node, "query", NULL); |
199 lm_message_node_set_attribute(y, "xmlns", NS_REGISTER); | 199 lm_message_node_set_attribute(y, "xmlns", NS_REGISTER); |
200 lm_message_node_add_child(y, "remove", NULL); | 200 lm_message_node_add_child(y, "remove", NULL); |
201 lm_connection_send(lconnection, iq, NULL); | 201 handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); |
202 lm_connection_send_with_reply(lconnection, iq, handler, NULL); | |
203 lm_message_handler_unref(handler); | |
202 lm_message_unref(iq); | 204 lm_message_unref(iq); |
203 } | 205 } |
204 | 206 |
205 // Cancel the subscriptions | 207 // Cancel the subscriptions |
206 xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); // cancel "from" | 208 xmpp_send_s10n(cleanjid, LM_MESSAGE_SUB_TYPE_UNSUBSCRIBED); // cancel "from" |
2036 // Send the node "store" to update the server. | 2038 // Send the node "store" to update the server. |
2037 // Note: the sender should check we're online. | 2039 // Note: the sender should check we're online. |
2038 void send_storage(LmMessageNode *store) | 2040 void send_storage(LmMessageNode *store) |
2039 { | 2041 { |
2040 LmMessage *iq; | 2042 LmMessage *iq; |
2043 LmMessageHandler *handler; | |
2041 LmMessageNode *query; | 2044 LmMessageNode *query; |
2042 | 2045 |
2043 if (!rosternotes) return; | 2046 if (!rosternotes) return; |
2044 | 2047 |
2045 iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, | 2048 iq = lm_message_new_with_sub_type(NULL, LM_MESSAGE_TYPE_IQ, |
2046 LM_MESSAGE_SUB_TYPE_SET); | 2049 LM_MESSAGE_SUB_TYPE_SET); |
2047 query = lm_message_node_add_child(iq->node, "query", NULL); | 2050 query = lm_message_node_add_child(iq->node, "query", NULL); |
2048 lm_message_node_set_attribute(query, "xmlns", NS_PRIVATE); | 2051 lm_message_node_set_attribute(query, "xmlns", NS_PRIVATE); |
2049 lm_message_node_insert_childnode(query, store); | 2052 lm_message_node_insert_childnode(query, store); |
2050 | 2053 |
2051 lm_connection_send(lconnection, iq, NULL); | 2054 handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE); |
2055 lm_connection_send_with_reply(lconnection, iq, handler, NULL); | |
2056 lm_message_handler_unref(handler); | |
2052 lm_message_unref(iq); | 2057 lm_message_unref(iq); |
2053 } | 2058 } |
2054 | 2059 |
2055 | 2060 |
2056 // xmpp_is_bookmarked(roomjid) | 2061 // xmpp_is_bookmarked(roomjid) |