comparison libpurple/protocols/jabber/iq.c @ 25657:ff29208e03ef

propagate from branch 'im.pidgin.pidgin' (head 75f0460d3679231b61d572e76fe02534a597c6b5) to branch 'im.pidgin.pidgin.vv' (head 7872d32a910cd4c1fbc3e2457295e4c1d40188f5)
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 27 May 2008 06:27:46 +0000
parents c6ba0a7028f4 92e71f6e10d4
children 10f5a529d2a6
comparison
equal deleted inserted replaced
23222:01e1468da703 25657:ff29208e03ef
311 JabberCallbackData *jcd; 311 JabberCallbackData *jcd;
312 xmlnode *query, *error, *x; 312 xmlnode *query, *error, *x;
313 const char *xmlns; 313 const char *xmlns;
314 const char *type, *id, *from; 314 const char *type, *id, *from;
315 JabberIqHandler *jih; 315 JabberIqHandler *jih;
316 316
317 query = xmlnode_get_child(packet, "query"); 317 query = xmlnode_get_child(packet, "query");
318 type = xmlnode_get_attrib(packet, "type"); 318 type = xmlnode_get_attrib(packet, "type");
319 from = xmlnode_get_attrib(packet, "from"); 319 from = xmlnode_get_attrib(packet, "from");
320 id = xmlnode_get_attrib(packet, "id"); 320 id = xmlnode_get_attrib(packet, "id");
321 321
335 if((jih = g_hash_table_lookup(iq_handlers, xmlns))) { 335 if((jih = g_hash_table_lookup(iq_handlers, xmlns))) {
336 jih(js, packet); 336 jih(js, packet);
337 return; 337 return;
338 } 338 }
339 } 339 }
340
341 if (xmlnode_get_child_with_namespace(packet, "session", "http://www.google.com/session")) {
342 jabber_google_session_parse(js, packet);
343 return;
344 }
340 345
341 if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) { 346 if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) {
342 jabber_si_parse(js, packet); 347 jabber_si_parse(js, packet);
343 return; 348 return;
344 } 349 }
346 if(xmlnode_get_child_with_namespace(packet, "new-mail", "google:mail:notify")) { 351 if(xmlnode_get_child_with_namespace(packet, "new-mail", "google:mail:notify")) {
347 jabber_gmail_poke(js, packet); 352 jabber_gmail_poke(js, packet);
348 return; 353 return;
349 } 354 }
350 355
351 purple_debug_info("jabber", "jabber_iq_parse\n");
352
353 if(xmlnode_get_child_with_namespace(packet, "ping", "urn:xmpp:ping")) { 356 if(xmlnode_get_child_with_namespace(packet, "ping", "urn:xmpp:ping")) {
354 jabber_ping_parse(js, packet); 357 jabber_ping_parse(js, packet);
355 return; 358 return;
356 } 359 }
360
361 #ifdef USE_FARSIGHT
362 /* handle session initiate XEP 0167 */
363 if (type && !strcmp(type, "set")) {
364 /* is this a Jingle package? */
365 xmlnode *jingle = xmlnode_get_child(packet, "jingle");
366 if (jingle) {
367 const char *action = xmlnode_get_attrib(jingle, "action");
368 purple_debug_info("jabber", "got Jingle package action = %s\n",
369 action);
370 if (!strcmp(action, "session-initiate")) {
371 jabber_handle_session_initiate(js, packet);
372 } else if (!strcmp(action, "session-accept")
373 || !strcmp(action, "content-accept")) {
374 jabber_handle_session_accept(js, packet);
375 } else if (!strcmp(action, "session-terminate")) {
376 jabber_handle_session_terminate(js, packet);
377 } else if (!strcmp(action, "transport-info")) {
378 jabber_handle_session_candidates(js, packet);
379 } else if (!strcmp(action, "content-replace")) {
380 jabber_handle_session_content_replace(js, packet);
381 }
382
383 return;
384 }
385 }
386 #endif
357 387
358 /* If we get here, send the default error reply mandated by XMPP-CORE */ 388 /* If we get here, send the default error reply mandated by XMPP-CORE */
359 if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) { 389 if(type && (!strcmp(type, "set") || !strcmp(type, "get"))) {
360 JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR); 390 JabberIq *iq = jabber_iq_new(js, JABBER_IQ_ERROR);
361 391