diff src/protocols/jabber/roster.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 3a229ad2fab0
line wrap: on
line diff
--- a/src/protocols/jabber/roster.c	Sat Jan 17 19:21:39 2004 +0000
+++ b/src/protocols/jabber/roster.c	Sat Jan 17 19:36:29 2004 +0000
@@ -147,14 +147,11 @@
 
 	js->roster_parsed = TRUE;
 
-	for(item = query->child; item; item = item->next)
+	for(item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item))
 	{
 		const char *jid, *name, *subscription, *ask;
 		JabberBuddy *jb;
 
-		if(item->type != NODE_TYPE_TAG || strcmp(item->name, "item"))
-			continue;
-
 		subscription = xmlnode_get_attrib(item, "subscription");
 		jid = xmlnode_get_attrib(item, "jid");
 		name = xmlnode_get_attrib(item, "name");
@@ -186,10 +183,8 @@
 		} else {
 			GSList *groups = NULL;
 
-			for(group = item->child; group; group = group->next) {
+			for(group = xmlnode_get_child(item, "group"); group; group = xmlnode_get_next_twin(group)) {
 				char *group_name;
-				if(group->type != NODE_TYPE_TAG || strcmp(group->name, "group"))
-					continue;
 
 				if(!(group_name = xmlnode_get_data(group)))
 					group_name = g_strdup("");