changeset 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 d4273346d52d
children 7f7c6b87f1b1
files mcabber/mcabber/xmpp.c mcabber/mcabber/xmpp_muc.c
diffstat 2 files changed, 20 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp.c	Wed Mar 30 21:56:35 2011 +0200
+++ b/mcabber/mcabber/xmpp.c	Wed Mar 30 22:02:48 2011 +0200
@@ -198,7 +198,9 @@
     y = lm_message_node_add_child(iq->node, "query", NULL);
     lm_message_node_set_attribute(y, "xmlns", NS_REGISTER);
     lm_message_node_add_child(y, "remove", NULL);
-    lm_connection_send(lconnection, iq, NULL);
+    handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE);
+    lm_connection_send_with_reply(lconnection, iq, handler, NULL);
+    lm_message_handler_unref(handler);
     lm_message_unref(iq);
   }
 
@@ -2038,6 +2040,7 @@
 void send_storage(LmMessageNode *store)
 {
   LmMessage *iq;
+  LmMessageHandler *handler;
   LmMessageNode *query;
 
   if (!rosternotes) return;
@@ -2048,7 +2051,9 @@
   lm_message_node_set_attribute(query, "xmlns", NS_PRIVATE);
   lm_message_node_insert_childnode(query, store);
 
-  lm_connection_send(lconnection, iq, NULL);
+  handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE);
+  lm_connection_send_with_reply(lconnection, iq, handler, NULL);
+  lm_message_handler_unref(handler);
   lm_message_unref(iq);
 }
 
--- a/mcabber/mcabber/xmpp_muc.c	Wed Mar 30 21:56:35 2011 +0200
+++ b/mcabber/mcabber/xmpp_muc.c	Wed Mar 30 22:02:48 2011 +0200
@@ -25,6 +25,7 @@
 #include <stdlib.h>
 
 #include "xmpp_helper.h"
+#include "xmpp_iq.h"
 #include "xmpp_muc.h"
 #include "events.h"
 #include "hooks.h"
@@ -194,6 +195,7 @@
                         const char *reason)
 {
   LmMessage *iq;
+  LmMessageHandler *handler;
   LmMessageNode *query, *x;
 
   if (!xmpp_is_online() || !roomid)
@@ -232,7 +234,9 @@
   if (reason)
     lm_message_node_add_child(x, "reason", reason);
 
-  lm_connection_send(lconnection, iq, NULL);
+  handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE);
+  lm_connection_send_with_reply(lconnection, iq, handler, NULL);
+  lm_message_handler_unref(handler);
   lm_message_unref(iq);
 
   return 0;
@@ -243,6 +247,7 @@
 void xmpp_room_unlock(const char *room)
 {
   LmMessageNode *node;
+  LmMessageHandler *handler;
   LmMessage *iq;
 
   if (!xmpp_is_online() || !room)
@@ -257,7 +262,9 @@
   lm_message_node_set_attributes(node, "xmlns", "jabber:x:data",
                                  "type", "submit", NULL);
 
-  lm_connection_send(lconnection, iq, NULL);
+  handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE);
+  lm_connection_send_with_reply(lconnection, iq, handler, NULL);
+  lm_message_handler_unref(handler);
   lm_message_unref(iq);
 }
 
@@ -266,6 +273,7 @@
 void xmpp_room_destroy(const char *room, const char *venue, const char *reason)
 {
   LmMessage *iq;
+  LmMessageHandler *handler;
   LmMessageNode *query, *x;
 
   if (!xmpp_is_online() || !room)
@@ -283,7 +291,9 @@
   if (reason)
     lm_message_node_add_child(x, "reason", reason);
 
-  lm_connection_send(lconnection, iq, NULL);
+  handler = lm_message_handler_new(handle_iq_dummy, NULL, FALSE);
+  lm_connection_send_with_reply(lconnection, iq, handler, NULL);
+  lm_message_handler_unref(handler);
   lm_message_unref(iq);
 }