Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/jab_iq.c @ 685:f033345d1315
Call IQ callback function when receiving a RESULT packet
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Mon, 06 Feb 2006 20:04:58 +0100 |
parents | 3282276e7413 |
children | 98de2d166a11 |
comparison
equal
deleted
inserted
replaced
684:3282276e7413 | 685:f033345d1315 |
---|---|
231 } | 231 } |
232 | 232 |
233 static void handle_iq_result(jconn conn, char *from, xmlnode xmldata) | 233 static void handle_iq_result(jconn conn, char *from, xmlnode xmldata) |
234 { | 234 { |
235 xmlnode x; | 235 xmlnode x; |
236 char *p; | 236 char *id; |
237 char *ns; | 237 char *ns; |
238 | 238 |
239 p = xmlnode_get_attrib(xmldata, "id"); | 239 id = xmlnode_get_attrib(xmldata, "id"); |
240 if (!p) { | 240 if (!id) { |
241 scr_LogPrint(LPRINT_LOG, "IQ result stanza with no ID, ignored."); | 241 scr_LogPrint(LPRINT_LOG, "IQ result stanza with no ID, ignored."); |
242 return; | 242 return; |
243 } | 243 } |
244 | 244 |
245 if (atoi(p) == s_id) { // Authentication XXX | 245 if (atoi(id) == s_id) { // Authentication XXX |
246 if (jstate == STATE_GETAUTH) { | 246 if (jstate == STATE_GETAUTH) { |
247 if ((x = xmlnode_get_tag(xmldata, "query")) != NULL) | 247 if ((x = xmlnode_get_tag(xmldata, "query")) != NULL) |
248 if (!xmlnode_get_tag(x, "digest")) { | 248 if (!xmlnode_get_tag(x, "digest")) { |
249 jc->sid = 0; | 249 jc->sid = 0; |
250 } | 250 } |
256 jstate = STATE_LOGGED; | 256 jstate = STATE_LOGGED; |
257 } | 257 } |
258 return; | 258 return; |
259 } | 259 } |
260 | 260 |
261 if (!iqs_callback(id, xmldata)) | |
262 return; | |
263 | |
261 /* | 264 /* |
262 if (!strcmp(p, "VCARDreq")) { | 265 if (!strcmp(id, "VCARDreq")) { |
263 x = xmlnode_get_firstchild(xmldata); | 266 x = xmlnode_get_firstchild(xmldata); |
264 if (!x) x = xmldata; | 267 if (!x) x = xmldata; |
265 | 268 |
266 scr_LogPrint(LPRINT_LOGNORM, "Got VCARD"); // TODO | 269 scr_LogPrint(LPRINT_LOGNORM, "Got VCARD"); // TODO |
267 return; | 270 return; |
268 } else if (!strcmp(p, "versionreq")) { | 271 } else if (!strcmp(id, "versionreq")) { |
269 scr_LogPrint(LPRINT_LOGNORM, "Got version"); // TODO | 272 scr_LogPrint(LPRINT_LOGNORM, "Got version"); // TODO |
270 return; | 273 return; |
271 } | 274 } |
272 */ | 275 */ |
273 | 276 |