libpurple/protocols/jabber/presence.c

changeset 27847
043b5d249732
parent 27844
32f08597374e
child 27860
2b75b87699c8
equal deleted inserted replaced
27846:9c591a669ffe 27847:043b5d249732
803 "http://jabber.org/protocol/muc#user"); 803 "http://jabber.org/protocol/muc#user");
804 if (chat->muc && x) { 804 if (chat->muc && x) {
805 const char *nick; 805 const char *nick;
806 const char *code = NULL; 806 const char *code = NULL;
807 const char *item_jid = NULL; 807 const char *item_jid = NULL;
808 const char *to;
808 xmlnode *stat; 809 xmlnode *stat;
809 xmlnode *item; 810 xmlnode *item;
810 811
811 item = xmlnode_get_child(x, "item"); 812 item = xmlnode_get_child(x, "item");
812 if (item) 813 if (item)
813 item_jid = xmlnode_get_attrib(item, "jid"); 814 item_jid = xmlnode_get_attrib(item, "jid");
814
815 815
816 stat = xmlnode_get_child(x, "status"); 816 stat = xmlnode_get_child(x, "status");
817 817
818 if (stat) 818 if (stat)
819 code = xmlnode_get_attrib(stat, "code"); 819 code = xmlnode_get_attrib(stat, "code");
887 * v1.24 section 7.1.10) being disconnected. Should be 887 * v1.24 section 7.1.10) being disconnected. Should be
888 * distinguished by the item_jid. 888 * distinguished by the item_jid.
889 * Also possibly works around bits of an Openfire bug. See 889 * Also possibly works around bits of an Openfire bug. See
890 * #8319. 890 * #8319.
891 */ 891 */
892 if (is_our_resource && !purple_strequal(from, item_jid)) { 892 to = xmlnode_get_attrib(packet, "to");
893 if (is_our_resource && item_jid && !purple_strequal(to, item_jid)) {
893 /* TODO: When the above is a loop, this needs to still act 894 /* TODO: When the above is a loop, this needs to still act
894 * sanely for all cases (this code is a little fragile). */ 895 * sanely for all cases (this code is a little fragile). */
895 if (!kick && !nick_change) 896 if (!kick && !nick_change)
896 /* Presumably, kicks and nick changes also affect us. */ 897 /* Presumably, kicks and nick changes also affect us. */
897 is_our_resource = FALSE; 898 is_our_resource = FALSE;

mercurial