pidgin: 2a6c0319: jabber: Handle non-compliant servers tha...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Wed Feb 10 02:16:18 EST 2010


-----------------------------------------------------------------
Revision: 2a6c0319124a6881d89d07208a717031b9b29aba
Ancestor: 8788ad89991015afa677dca912fa12dba5b5f1f1
Author: darkrain42 at pidgin.im
Date: 2010-02-10T07:09:52
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/2a6c0319124a6881d89d07208a717031b9b29aba

Modified files:
        ChangeLog libpurple/protocols/jabber/bosh.c

ChangeLog: 

jabber: Handle non-compliant servers that don't put stanzas in the right namespace.

Closes #11315

-------------- next part --------------
============================================================
--- ChangeLog	a277d3b45be9bd766b7b9cd608cd05e61a4a3fd7
+++ ChangeLog	7ff48682a8ebd2738f0645d4147a9bf1bd97ece3
@@ -56,6 +56,8 @@ version 2.6.6 (??/??/20??):
 	* Don't send custom smileys larger than the recommended maximum object size
 	  specified in the BoB XEP.   This prevents a client from being
 	  disconnected by servers that dislike overly-large stanzas.
+	* Fix receiving messages without markup over an Openfire BOSH connection
+	  (forcibly put the stanzas in the jabber:client namespace).
 
 	Yahoo:
 	* Don't send <span> and </span> tags.  (Fartash Faghri)
============================================================
--- libpurple/protocols/jabber/bosh.c	df36f571ff7cd80f9f38aa7ec837f0ce4ef76372
+++ libpurple/protocols/jabber/bosh.c	4d708e04e0b7835167e16055dd9d3dac6545be36
@@ -476,6 +476,18 @@ static void jabber_bosh_connection_recei
 		/* jabber_process_packet might free child */
 		xmlnode *next = child->next;
 		if (child->type == XMLNODE_TYPE_TAG) {
+			const char *xmlns = xmlnode_get_namespace(child);
+			/*
+			 * Workaround for non-compliant servers that don't stamp
+			 * the right xmlns on these packets.  See #11315.
+			 */
+			if ((xmlns == NULL /* shouldn't happen, but is equally wrong */ ||
+					g_str_equal(xmlns, NS_BOSH)) &&
+				(g_str_equal(child->name, "iq") ||
+				 g_str_equal(child->name, "message") ||
+				 g_str_equal(child->name, "presence"))) {
+				xmlnode_set_namespace(child, NS_XMPP_CLIENT);
+			}
 			jabber_process_packet(js, &child);
 		}
 


More information about the Commits mailing list