diff libpurple/protocols/jabber/roster.c @ 25648:050052891c55

Pass IQ handlers type, from, id, and the child node As QuLogic pointed out in 8a80f271, it's pointless for the handlers to re-get the information from the IQ stanza. Additionally, instead of string-matching the type everywhere, pass around a JabberIqType. Last, 'child' cannot be NULL, but 'from' may be.
author Paul Aurich <paul@darkrain42.org>
date Sun, 08 Feb 2009 06:31:18 +0000
parents fae699fece1f
children 439f07ce4c8a
line wrap: on
line diff
--- a/libpurple/protocols/jabber/roster.c	Sun Feb 08 04:30:23 2009 +0000
+++ b/libpurple/protocols/jabber/roster.c	Sun Feb 08 06:31:18 2009 +0000
@@ -142,10 +142,10 @@
 	g_slist_free(buddies);
 }
 
-void jabber_roster_parse(JabberStream *js, xmlnode *packet)
+void jabber_roster_parse(JabberStream *js, const char *from,
+                         JabberIqType type, const char *id, xmlnode *query)
 {
-	xmlnode *query, *item, *group;
-	const char *from = xmlnode_get_attrib(packet, "from");
+	xmlnode *item, *group;
 
 	if(from) {
 		char *from_norm;
@@ -166,10 +166,6 @@
 			return;
 	}
 
-	query = xmlnode_get_child(packet, "query");
-	if(!query)
-		return;
-
 	js->currently_parsing_roster_push = TRUE;
 
 	for(item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item))