The item JID will match the 'to' JID, not the from.

Thu, 16 Jul 2009 22:56:37 +0000

author
Paul Aurich <darkrain42@pidgin.im>
date
Thu, 16 Jul 2009 22:56:37 +0000
changeset 27847
043b5d249732
parent 27846
9c591a669ffe
child 27848
a52e369d98c6
child 27851
4bf0c00d5623

The item JID will match the 'to' JID, not the from.

Also, only try to be clever when the item JID is set.

libpurple/protocols/jabber/presence.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/presence.c	Thu Jul 16 22:53:37 2009 +0000
+++ b/libpurple/protocols/jabber/presence.c	Thu Jul 16 22:56:37 2009 +0000
@@ -805,6 +805,7 @@
 				const char *nick;
 				const char *code = NULL;
 				const char *item_jid = NULL;
+				const char *to;
 				xmlnode *stat;
 				xmlnode *item;
 
@@ -812,7 +813,6 @@
 				if (item)
 					item_jid = xmlnode_get_attrib(item, "jid");
 
-
 				stat = xmlnode_get_child(x, "status");
 
 				if (stat)
@@ -889,7 +889,8 @@
 				 * Also possibly works around bits of an Openfire bug. See
 				 * #8319.
 				 */
-				if (is_our_resource && !purple_strequal(from, item_jid)) {
+				to = xmlnode_get_attrib(packet, "to");
+				if (is_our_resource && item_jid && !purple_strequal(to, item_jid)) {
 					/* TODO: When the above is a loop, this needs to still act
 					 * sanely for all cases (this code is a little fragile). */
 					if (!kick && !nick_change)

mercurial