restore xmpp ping callback that was removed in [bc039f78321d] Fixes #5510
This commit is contained in:
parent
15408e8e86
commit
b82ea5feff
|
@ -1307,6 +1307,11 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
if self.connection:
|
if self.connection:
|
||||||
self.connection.send(' ')
|
self.connection.send(' ')
|
||||||
|
|
||||||
|
def _on_xmpp_ping_answer(self, iq_obj):
|
||||||
|
id_ = unicode(iq_obj.getAttr('id'))
|
||||||
|
if id_ == self.awaiting_xmpp_ping_id:
|
||||||
|
self.awaiting_xmpp_ping_id = None
|
||||||
|
|
||||||
def sendPing(self, pingTo=None):
|
def sendPing(self, pingTo=None):
|
||||||
"""
|
"""
|
||||||
Send XMPP Ping (XEP-0199) request. If pingTo is not set, ping is sent to
|
Send XMPP Ping (XEP-0199) request. If pingTo is not set, ping is sent to
|
||||||
|
@ -1335,7 +1340,7 @@ class Connection(CommonConnection, ConnectionHandlers):
|
||||||
timePing = time_time()
|
timePing = time_time()
|
||||||
self.connection.SendAndCallForResponse(iq, _on_response)
|
self.connection.SendAndCallForResponse(iq, _on_response)
|
||||||
else:
|
else:
|
||||||
self.connection.send(iq)
|
self.connection.SendAndCallForResponse(iq, self._on_xmpp_ping_answer)
|
||||||
gajim.idlequeue.set_alarm(self.check_pingalive, gajim.config.get_per(
|
gajim.idlequeue.set_alarm(self.check_pingalive, gajim.config.get_per(
|
||||||
'accounts', self.name, 'time_for_ping_alive_answer'))
|
'accounts', self.name, 'time_for_ping_alive_answer'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue