diff src/protocols/jabber/presence.c @ 13806:25e63008d3bb

[gaim-migrate @ 16229] Use libxml2 for XML parsing, if available. The biggest benefit from this is actual support for XML namespaces. This fixes a handful of Google Talk integration problems, including typing notifications and buddy icons. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Thu, 08 Jun 2006 01:03:51 +0000
parents d2aadcdbec6c
children 2bac009eaa0c
line wrap: on
line diff
--- a/src/protocols/jabber/presence.c	Wed Jun 07 15:58:27 2006 +0000
+++ b/src/protocols/jabber/presence.c	Thu Jun 08 01:03:51 2006 +0000
@@ -121,7 +121,7 @@
 
 	if(js->avatar_hash) {
 		x = xmlnode_new_child(presence, "x");
-		xmlnode_set_attrib(x, "xmlns", "vcard-temp:x:update");
+		xmlnode_set_namespace(x, "vcard-temp:x:update");
 		photo = xmlnode_new_child(x, "photo");
 		xmlnode_insert_data(photo, js->avatar_hash, -1);
 	}
@@ -167,7 +167,7 @@
 
 	/* JEP-0115 */
 	c = xmlnode_new_child(presence, "c");
-	xmlnode_set_attrib(c, "xmlns",  "http://jabber.org/protocol/caps");
+	xmlnode_set_namespace(c, "http://jabber.org/protocol/caps");
 	xmlnode_set_attrib(c, "node", CAPS0115_NODE);
 	xmlnode_set_attrib(c, "ver", VERSION);
 
@@ -290,7 +290,6 @@
 	gboolean muc = FALSE;
 	char *avatar_hash = NULL;
 
-
 	if(!(jb = jabber_buddy_find(js, from, TRUE)))
 		return;
 
@@ -363,7 +362,7 @@
 				g_free(p);
 			}
 		} else if(!strcmp(y->name, "x")) {
-			const char *xmlns = xmlnode_get_attrib(y, "xmlns");
+			const char *xmlns = xmlnode_get_namespace(y);
 			if(xmlns && !strcmp(xmlns, "jabber:x:delay")) {
 				/* XXX: compare the time.  jabber:x:delay can happen on presence packets that aren't really and truly delayed */
 				delayed = TRUE;
@@ -464,7 +463,7 @@
 				for(x = xmlnode_get_child(packet, "x"); x; x = xmlnode_get_next_twin(x)) {
 					const char *xmlns, *nick, *code;
 					xmlnode *stat, *item;
-					if(!(xmlns = xmlnode_get_attrib(x, "xmlns")) ||
+					if(!(xmlns = xmlnode_get_namespace(x)) ||
 							strcmp(xmlns, "http://jabber.org/protocol/muc#user"))
 						continue;
 					if(!(stat = xmlnode_get_child(x, "status")))
@@ -560,7 +559,7 @@
 					iq = jabber_iq_new(js, JABBER_IQ_GET);
 					xmlnode_set_attrib(iq->node, "to", buddy_name);
 					vcard = xmlnode_new_child(iq->node, "vCard");
-					xmlnode_set_attrib(vcard, "xmlns", "vcard-temp");
+					xmlnode_set_namespace(vcard, "vcard-temp");
 
 					jabber_iq_set_callback(iq, jabber_vcard_parse_avatar, NULL);
 					jabber_iq_send(iq);