Mercurial > pidgin.yaz
comparison libpurple/protocols/jabber/roster.c @ 25933: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 |
comparison
equal
deleted
inserted
replaced
25932:969c89c09ad7 | 25933:050052891c55 |
---|---|
140 | 140 |
141 g_free(my_bare_jid); | 141 g_free(my_bare_jid); |
142 g_slist_free(buddies); | 142 g_slist_free(buddies); |
143 } | 143 } |
144 | 144 |
145 void jabber_roster_parse(JabberStream *js, xmlnode *packet) | 145 void jabber_roster_parse(JabberStream *js, const char *from, |
146 { | 146 JabberIqType type, const char *id, xmlnode *query) |
147 xmlnode *query, *item, *group; | 147 { |
148 const char *from = xmlnode_get_attrib(packet, "from"); | 148 xmlnode *item, *group; |
149 | 149 |
150 if(from) { | 150 if(from) { |
151 char *from_norm; | 151 char *from_norm; |
152 gboolean invalid; | 152 gboolean invalid; |
153 | 153 |
163 g_free(from_norm); | 163 g_free(from_norm); |
164 | 164 |
165 if(invalid) | 165 if(invalid) |
166 return; | 166 return; |
167 } | 167 } |
168 | |
169 query = xmlnode_get_child(packet, "query"); | |
170 if(!query) | |
171 return; | |
172 | 168 |
173 js->currently_parsing_roster_push = TRUE; | 169 js->currently_parsing_roster_push = TRUE; |
174 | 170 |
175 for(item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item)) | 171 for(item = xmlnode_get_child(query, "item"); item; item = xmlnode_get_next_twin(item)) |
176 { | 172 { |