comparison libpurple/protocols/jabber/ping.c @ 26465:ae41d8e827e3

Convert all the XMPP IQ callbacks to a typedef similar to the IQ Handlers.
author Paul Aurich <paul@darkrain42.org>
date Fri, 13 Mar 2009 02:26:45 +0000
parents c2cb082f5f2f
children d00a8111e479
comparison
equal deleted inserted replaced
26464:a4a5825fb1bb 26465:ae41d8e827e3
49 } else if (type == JABBER_IQ_SET) { 49 } else if (type == JABBER_IQ_SET) {
50 /* XXX: error */ 50 /* XXX: error */
51 } 51 }
52 } 52 }
53 53
54 static void jabber_ping_result_cb(JabberStream *js, xmlnode *packet, 54 static void jabber_ping_result_cb(JabberStream *js, const char *from,
55 gpointer data) 55 JabberIqType type, const char *id,
56 xmlnode *packet, gpointer data)
56 { 57 {
57 const char *type = xmlnode_get_attrib(packet, "type");
58 const char *from = xmlnode_get_attrib(packet, "from");
59 char *own_bare_jid = g_strdup_printf("%s@%s", js->user->node, 58 char *own_bare_jid = g_strdup_printf("%s@%s", js->user->node,
60 js->user->domain); 59 js->user->domain);
61 60
62 if (!from || !strcmp(from, own_bare_jid)) { 61 if (!from || !strcmp(from, own_bare_jid)) {
63 /* If the pong is from our bare JID, treat it as a return from the 62 /* If the pong is from our bare JID, treat it as a return from the
64 * keepalive functions */ 63 * keepalive functions */
65 jabber_keepalive_pong_cb(js); 64 jabber_keepalive_pong_cb(js);
66 } 65 }
67 g_free(own_bare_jid); 66 g_free(own_bare_jid);
68 67
69 if(type && !strcmp(type, "result")) { 68 if (type == JABBER_IQ_RESULT) {
70 purple_debug_info("jabber", "PONG!\n"); 69 purple_debug_info("jabber", "PONG!\n");
71 } else { 70 } else {
72 purple_debug_info("jabber", "(not supported)\n"); 71 purple_debug_info("jabber", "(not supported)\n");
73 } 72 }
74 } 73 }