diff libpurple/protocols/jabber/google.c @ 25428:e30e9779e7bf

In jabber_iq_parse, xmlnode_get_child is called for a few special cases, and then the original xmlnode is passed to the handler. That seems kind of pointless, since jabber_iq_parse has all the data. So I just passed the data necessary for each handler instead. I didn't change the query handlers since they seem to require the parent. I assume the point was to go for a unified prototype, but since these handlers are all special cases, I think it's okay to give them a special signature as well.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Thu, 05 Feb 2009 05:42:58 +0000
parents e1bddd9c5c88
children 36c73d036026
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Thu Feb 05 04:23:14 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Thu Feb 05 05:42:58 2009 +0000
@@ -144,9 +144,8 @@
 }
 
 void
-jabber_gmail_poke(JabberStream *js, xmlnode *packet)
+jabber_gmail_poke(JabberStream *js, const char *type)
 {
-	const char *type;
 	xmlnode *query;
 	JabberIq *iq;
 
@@ -154,11 +153,8 @@
 	if (!purple_account_get_check_mail(js->gc->account))
 		return;
 
-	type = xmlnode_get_attrib(packet, "type");
-
-
 	/* Is this an initial incoming mail notification? If so, send a request for more info */
-	if (strcmp(type, "set") || !xmlnode_get_child(packet, "new-mail"))
+	if (strcmp(type, "set"))
 		return;
 
 	purple_debug(PURPLE_DEBUG_MISC, "jabber",