Mercurial > pidgin
comparison libpurple/protocols/jabber/bosh.c @ 29017:f521dd7c75b5
jabber: Handle non-compliant servers that don't put stanzas in the right namespace.
Closes #11315
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Wed, 10 Feb 2010 07:09:52 +0000 |
parents | 931d6906291b |
children | 618c4165d4f8 |
comparison
equal
deleted
inserted
replaced
29016:1d58c44c87f4 | 29017:f521dd7c75b5 |
---|---|
474 child = node->child; | 474 child = node->child; |
475 while (child != NULL) { | 475 while (child != NULL) { |
476 /* jabber_process_packet might free child */ | 476 /* jabber_process_packet might free child */ |
477 xmlnode *next = child->next; | 477 xmlnode *next = child->next; |
478 if (child->type == XMLNODE_TYPE_TAG) { | 478 if (child->type == XMLNODE_TYPE_TAG) { |
479 const char *xmlns = xmlnode_get_namespace(child); | |
480 /* | |
481 * Workaround for non-compliant servers that don't stamp | |
482 * the right xmlns on these packets. See #11315. | |
483 */ | |
484 if ((xmlns == NULL /* shouldn't happen, but is equally wrong */ || | |
485 g_str_equal(xmlns, NS_BOSH)) && | |
486 (g_str_equal(child->name, "iq") || | |
487 g_str_equal(child->name, "message") || | |
488 g_str_equal(child->name, "presence"))) { | |
489 xmlnode_set_namespace(child, NS_XMPP_CLIENT); | |
490 } | |
479 jabber_process_packet(js, &child); | 491 jabber_process_packet(js, &child); |
480 } | 492 } |
481 | 493 |
482 child = next; | 494 child = next; |
483 } | 495 } |