diff src/protocols/jabber/chat.c @ 8135:8f4ce853e685

[gaim-migrate @ 8840] created a convenience function, and used it. a lot. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Sat, 17 Jan 2004 19:36:29 +0000
parents 81a63a9bff88
children e283be34aadf
line wrap: on
line diff
--- a/src/protocols/jabber/chat.c	Sat Jan 17 19:21:39 2004 +0000
+++ b/src/protocols/jabber/chat.c	Sat Jan 17 19:36:29 2004 +0000
@@ -310,11 +310,8 @@
 		if(!(query = xmlnode_get_child(packet, "query")))
 			return;
 
-		for(x = query->child; x; x = x->next) {
+		for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) {
 			const char *xmlns;
-			if(x->type != NODE_TYPE_TAG || strcmp(x->name, "x"))
-				continue;
-
 			if(!(xmlns = xmlnode_get_attrib(x, "xmlns")))
 				continue;
 
@@ -462,10 +459,8 @@
 		if(!(query = xmlnode_get_child(packet, "query")))
 			return;
 
-		for(x = query->child; x; x = x->next) {
+		for(x = xmlnode_get_child(query, "x"); x; x = xmlnode_get_next_twin(x)) {
 			const char *xmlns;
-			if(x->type != NODE_TYPE_TAG || strcmp(x->name, "x"))
-				continue;
 
 			if(!(xmlns = xmlnode_get_attrib(x, "xmlns")))
 				continue;
@@ -632,16 +627,12 @@
 		return;
 	}
 
-	for(item = query->child; item; item = item->next) {
+	for(item = xmlnode_get_child(query, "item"); item;
+			item = xmlnode_get_next_twin(item)) {
 		const char *name;
 		GaimRoomlistRoom *room;
 		JabberID *jid;
 
-		if(item->type != NODE_TYPE_TAG)
-			continue;
-		if(strcmp(item->name, "item"))
-			continue;
-
 		if(!(jid = jabber_id_new(xmlnode_get_attrib(item, "jid"))))
 			continue;
 		name = xmlnode_get_attrib(item, "name");