diff libpurple/protocols/jabber/message.c @ 28404:41992511531f

jabber: Improved support for XEP-0249 (and document the legacy stuff). Ironically, I don't think there's a way to invoke the code in chat.c as-is, since it's specifically invoked if the server doesn't purport to be a MUC.
author Paul Aurich <paul@darkrain42.org>
date Sat, 17 Oct 2009 00:37:04 +0000
parents e8717ca47d25
children d10e62b804ea 168fcd171875 5502f855ec2b
line wrap: on
line diff
--- a/libpurple/protocols/jabber/message.c	Fri Oct 16 20:22:26 2009 +0000
+++ b/libpurple/protocols/jabber/message.c	Sat Oct 17 00:37:04 2009 +0000
@@ -758,9 +758,22 @@
 					jm->type != JABBER_MESSAGE_ERROR) {
 				const char *jid = xmlnode_get_attrib(child, "jid");
 				if(jid) {
+					const char *reason = xmlnode_get_attrib(child, "reason");
+					const char *password = xmlnode_get_attrib(child, "password");
+
 					jm->type = JABBER_MESSAGE_GROUPCHAT_INVITE;
 					g_free(jm->to);
 					jm->to = g_strdup(jid);
+
+					if (reason) {
+						g_free(jm->body);
+						jm->body = g_strdup(reason);
+					}
+
+					if (password) {
+						g_free(jm->password);
+						jm->password = g_strdup(password);
+					}
 				}
 			} else if(!strcmp(xmlns, "http://jabber.org/protocol/muc#user") &&
 					jm->type != JABBER_MESSAGE_ERROR) {
@@ -775,8 +788,10 @@
 						g_free(jm->body);
 						jm->body = xmlnode_get_data(reason);
 					}
-					if((password = xmlnode_get_child(child, "password")))
+					if((password = xmlnode_get_child(child, "password"))) {
+						g_free(jm->password);
 						jm->password = xmlnode_get_data(password);
+					}
 
 					jm->type = JABBER_MESSAGE_GROUPCHAT_INVITE;
 				}