changeset 27594:b448b259e3cf

The item JID will match the 'to' JID, not the from. Also, only try to be clever when the item JID is set.
author Paul Aurich <paul@darkrain42.org>
date Thu, 16 Jul 2009 22:56:37 +0000
parents caed9d0b1e67
children d53d082f1641 53c6b8d95ea5
files libpurple/protocols/jabber/presence.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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)