diff options
author | Paul Aurich <darkrain42@pidgin.im> | 2009-02-08 16:50:58 +0000 |
---|---|---|
committer | Paul Aurich <darkrain42@pidgin.im> | 2009-02-08 16:50:58 +0000 |
commit | d695334ae58dbdc186e33ba679ae4ec0b4f5423d (patch) | |
tree | d5fe1faa5b6ec8e240f4828feef1cd96d9a288c9 | |
parent | 91ce1b0ca4b28b8a7439bc3c5bb565f925038122 (diff) | |
download | pidgin-d695334ae58dbdc186e33ba679ae4ec0b4f5423d.tar.gz |
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.
-rw-r--r-- | libpurple/protocols/jabber/ping.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/libpurple/protocols/jabber/ping.c b/libpurple/protocols/jabber/ping.c index bccdd4cb20..cc4bdf8d96 100644 --- a/libpurple/protocols/jabber/ping.c +++ b/libpurple/protocols/jabber/ping.c @@ -38,8 +38,6 @@ void 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 @@ static void jabber_ping_result_cb(JabberStream *js, xmlnode *packet, { const char *type = xmlnode_get_attrib(packet, "type"); const char *from = xmlnode_get_attrib(packet, "from"); + char *own_bare_jid = g_strdup_printf("%s@%s", js->user->node, + js->user->domain); - purple_debug_info("jabber", "jabber_ping_result_cb\n"); - - 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 @@ gboolean jabber_ping_jid(JabberStream *js, const char *jid) 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); |