Mercurial > pidgin.yaz
changeset 22449:4baa8b7ad5b4
merge of '1ba8fbd2ac54a6b25df759681a854ccc43e6abff'
and 'a4c67ebda7af92f03a3da8f978c16b2a4e6d0891'
author | Evan Schoenberg <evan.s@dreskin.net> |
---|---|
date | Tue, 11 Mar 2008 23:00:03 +0000 |
parents | 9b154f484d64 (current diff) 8ec6ac1b9e26 (diff) |
children | 57fef22fa7a8 |
files | |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c Tue Mar 11 21:41:53 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Tue Mar 11 23:00:03 2008 +0000 @@ -406,14 +406,17 @@ void jabber_keepalive(PurpleConnection *gc) { JabberStream *js = gc->proto_data; - JabberIq *iq = jabber_iq_new(js, JABBER_IQ_GET); - xmlnode *ping = xmlnode_new_child(iq->node, "ping"); - xmlnode_set_namespace(ping, "urn:xmpp:ping"); - - js->keepalive_timeout = purple_timeout_add_seconds(120, (GSourceFunc)(jabber_pong_timeout), gc); - jabber_iq_set_callback(iq, jabber_pong_cb, GINT_TO_POINTER(js->keepalive_timeout)); - jabber_iq_send(iq); + if (js->keepalive_timeout == -1) { + JabberIq *iq = jabber_iq_new(js, JABBER_IQ_GET); + + xmlnode *ping = xmlnode_new_child(iq->node, "ping"); + xmlnode_set_namespace(ping, "urn:xmpp:ping"); + + js->keepalive_timeout = purple_timeout_add_seconds(120, (GSourceFunc)(jabber_pong_timeout), gc); + jabber_iq_set_callback(iq, jabber_pong_cb, GINT_TO_POINTER(js->keepalive_timeout)); + jabber_iq_send(iq); + } } static void