# HG changeset patch # User Paul Aurich # Date 1234111858 0 # Node ID c2cb082f5f2fb9fcfa805bd49a94fb3a1b1fb05e # Parent 150282919040408895b53537057d44ea3ee7678a Reduce the debug log spam from the ping code and fix a logic error. The response will come from our own bare JID (or have no 'from' attributes) for the keepalive pings. diff -r 150282919040 -r c2cb082f5f2f libpurple/protocols/jabber/ping.c --- a/libpurple/protocols/jabber/ping.c Sun Feb 08 08:12:19 2009 +0000 +++ b/libpurple/protocols/jabber/ping.c Sun Feb 08 16:50:58 2009 +0000 @@ -38,8 +38,6 @@ jabber_ping_parse(JabberStream *js, const char *from, JabberIqType type, const char *id, xmlnode *ping) { - purple_debug_info("jabber", "jabber_ping_parse\n"); - if (type == JABBER_IQ_GET) { JabberIq *iq = jabber_iq_new(js, JABBER_IQ_RESULT); @@ -58,14 +56,15 @@ { const char *type = xmlnode_get_attrib(packet, "type"); const char *from = xmlnode_get_attrib(packet, "from"); - - purple_debug_info("jabber", "jabber_ping_result_cb\n"); + char *own_bare_jid = g_strdup_printf("%s@%s", js->user->node, + js->user->domain); - if (!from || !strcmp(from, js->user->domain)) { - /* If the pong is from our server, treat it as a return from the + if (!from || !strcmp(from, own_bare_jid)) { + /* If the pong is from our bare JID, treat it as a return from the * keepalive functions */ jabber_keepalive_pong_cb(js); } + g_free(own_bare_jid); if(type && !strcmp(type, "result")) { purple_debug_info("jabber", "PONG!\n"); @@ -79,8 +78,6 @@ JabberIq *iq; xmlnode *ping; - purple_debug_info("jabber", "jabber_ping_jid\n"); - iq = jabber_iq_new(js, JABBER_IQ_GET); if (jid) xmlnode_set_attrib(iq->node, "to", jid);