diff options
author | Yann Leboulanger <asterix@lagaule.org> | 2009-05-01 13:40:03 +0400 |
---|---|---|
committer | Yann Leboulanger <asterix@lagaule.org> | 2009-05-01 13:40:03 +0400 |
commit | f8267ad047854bd3de3b8383d8c4b96b8596253d (patch) | |
tree | cbb59586a69973a781e6563135f6b2961e46fb4e | |
parent | 5d8e96ad47184f75d4094d2e8c013bcd10383334 (diff) |
missing commit. see #4643
-rw-r--r-- | src/common/connection.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/common/connection.py b/src/common/connection.py index d9ab31181..362631095 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -147,9 +147,15 @@ class Connection(ConnectionHandlers): 'hostname': socket.gethostname() }) if gajim.config.get_per('accounts', self.name, 'keep_alives_enabled'): - self.keepalives = gajim.config.get_per('accounts', self.name,'keep_alive_every_foo_secs') + self.keepalives = gajim.config.get_per('accounts', self.name, + 'keep_alive_every_foo_secs') else: self.keepalives = 0 + if gajim.config.get_per('accounts', self.name, 'ping_alives_enabled'): + self.pingalives = gajim.config.get_per('accounts', self.name, + 'ping_alive_every_foo_secs') + else: + self.pingalives = 0 self.privacy_rules_supported = False self.blocked_list = [] self.blocked_contacts = [] @@ -832,8 +838,8 @@ class Connection(ConnectionHandlers): self.connection.SendAndCallForResponse(iq, _on_response) else: self.connection.send(iq) - gajim.idlequeue.set_alarm(self.check_keepalive, gajim.config.get_per( - 'accounts', self.name, 'time_for_keep_alive_answer')) + gajim.idlequeue.set_alarm(self.check_pingalive, gajim.config.get_per( + 'accounts', self.name, 'time_for_ping_alive_answer')) def get_active_default_lists(self): if not self.connection: @@ -1024,7 +1030,7 @@ class Connection(ConnectionHandlers): if not self.connection: return self.connection.set_send_timeout(self.keepalives, self.send_keepalive) - self.connection.set_send_timeout2(self.keepalives * 2, self.sendPing) + self.connection.set_send_timeout2(self.pingalives, self.sendPing) self.connection.onreceive(None) iq = common.xmpp.Iq('get', common.xmpp.NS_PRIVACY, xmlns = '') id_ = self.connection.getAnID() @@ -1898,7 +1904,7 @@ class Connection(ConnectionHandlers): c.setTagData('reason', reason) self.connection.send(message) - def check_keepalive(self): + def check_pingalive(self): if self.awaiting_xmpp_ping_id: # We haven't got the pong in time, disco and reconnect self._disconnectedReconnCB() |