diff mcabber/mcabber/xmpp.c @ 1951:1a01a7ef4e43

Add support for XEP-0249 / Direct MUC Invitations (Myhailo Danylenko) Patch merged from isbear's mcabber-experimental repository.
author Mikael Berthe <mikael@lilotux.net>
date Mon, 14 Mar 2011 12:53:27 +0100
parents 118524e9d7b6
children 9f443617e96b
line wrap: on
line diff
--- a/mcabber/mcabber/xmpp.c	Mon Mar 14 12:50:18 2011 +0100
+++ b/mcabber/mcabber/xmpp.c	Mon Mar 14 12:53:27 2011 +0100
@@ -1295,6 +1295,18 @@
     x = lm_message_node_find_xmlns(m->node, NS_MUC_USER);
     if (x && !strcmp(x->name, "x"))
       got_muc_message(from, x);
+
+    x = lm_message_node_find_xmlns(m->node, NS_X_CONFERENCE);
+
+    if (x && !strcmp(x->name, "x")) {
+      const char *jid = lm_message_node_get_attribute(x, "jid");
+      if (jid) {
+        const char *reason = lm_message_node_get_attribute(x, "reason");
+        const char *password = lm_message_node_get_attribute(x, "password");
+        // FIXME we shouldn't send decline stanzas in this case
+        got_invite(from, jid, reason, password, FALSE);
+      }
+    }
   }
 
   return LM_HANDLER_RESULT_REMOVE_MESSAGE;