pidgin: 0e72bb34: jabber: Avoid an assertion warning

darkrain42 at pidgin.im darkrain42 at pidgin.im
Sat Jul 31 16:45:46 EDT 2010


----------------------------------------------------------------------
Revision: 0e72bb347f64bc411baa5332c8045865628fb170
Parent:   870254bc565eb9ffa4f78dce9b5f8e9bd1ebb78f
Author:   darkrain42 at pidgin.im
Date:     07/31/10 16:18:59
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/0e72bb347f64bc411baa5332c8045865628fb170

Changelog: 

jabber: Avoid an assertion warning

As noticed by Elliott

Changes against parent 870254bc565eb9ffa4f78dce9b5f8e9bd1ebb78f

  patched  libpurple/protocols/jabber/chat.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/chat.c	d3880938cb5c9d5a92e15a710460a139b3008a94
+++ libpurple/protocols/jabber/chat.c	fc27a39f9c6647917691292ebd144b894517cbd9
@@ -173,8 +173,10 @@ void jabber_chat_invite(PurpleConnection
 		xmlnode_set_namespace(x, "http://jabber.org/protocol/muc#user");
 		invite = xmlnode_new_child(x, "invite");
 		xmlnode_set_attrib(invite, "to", name);
-		body = xmlnode_new_child(invite, "reason");
-		xmlnode_insert_data(body, msg, -1);
+		if (msg) {
+			body = xmlnode_new_child(invite, "reason");
+			xmlnode_insert_data(body, msg, -1);
+		}
 	} else {
 		xmlnode_set_attrib(message, "to", name);
 		/*
@@ -184,14 +186,17 @@ void jabber_chat_invite(PurpleConnection
 		 *
 		 * Left here for compatibility.
 		 */
-		body = xmlnode_new_child(message, "body");
-		xmlnode_insert_data(body, msg, -1);
+		if (msg) {
+			body = xmlnode_new_child(message, "body");
+			xmlnode_insert_data(body, msg, -1);
+		}
 
 		x = xmlnode_new_child(message, "x");
 		xmlnode_set_attrib(x, "jid", room_jid);
 
 		/* The better place for it! XEP-0249 style. */
-		xmlnode_set_attrib(x, "reason", msg);
+		if (msg)
+			xmlnode_set_attrib(x, "reason", msg);
 		xmlnode_set_namespace(x, "jabber:x:conference");
 	}
 


More information about the Commits mailing list