# HG changeset patch # User Paul Aurich # Date 1265785792 0 # Node ID f521dd7c75b585e21c0aa5af371fb66bdff9f23a # Parent 1d58c44c87f4ffc637a09ed02a2e65643e888742 jabber: Handle non-compliant servers that don't put stanzas in the right namespace. Closes #11315 diff -r 1d58c44c87f4 -r f521dd7c75b5 ChangeLog --- a/ChangeLog Wed Feb 10 06:43:51 2010 +0000 +++ b/ChangeLog Wed Feb 10 07:09:52 2010 +0000 @@ -56,6 +56,8 @@ * 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 and tags. (Fartash Faghri) diff -r 1d58c44c87f4 -r f521dd7c75b5 libpurple/protocols/jabber/bosh.c --- a/libpurple/protocols/jabber/bosh.c Wed Feb 10 06:43:51 2010 +0000 +++ b/libpurple/protocols/jabber/bosh.c Wed Feb 10 07:09:52 2010 +0000 @@ -476,6 +476,18 @@ /* 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); }