fix time.time() call. Fixes #8446

This commit is contained in:
Yann Leboulanger 2016-11-28 22:23:42 +01:00
parent 471329a0e0
commit 7b3d595665

View file

@ -1632,7 +1632,7 @@ class Connection(CommonConnection, ConnectionHandlers):
iq.addChild(name='ping', namespace=nbxmpp.NS_PING) iq.addChild(name='ping', namespace=nbxmpp.NS_PING)
iq.setID(id_) iq.setID(id_)
def _on_response(resp): def _on_response(resp):
timePong = time_time() timePong = time.time()
if not nbxmpp.isResultNode(resp): if not nbxmpp.isResultNode(resp):
gajim.nec.push_incoming_event(PingErrorEvent(None, conn=self, gajim.nec.push_incoming_event(PingErrorEvent(None, conn=self,
contact=pingTo)) contact=pingTo))
@ -1641,7 +1641,7 @@ class Connection(CommonConnection, ConnectionHandlers):
gajim.nec.push_incoming_event(PingReplyEvent(None, conn=self, gajim.nec.push_incoming_event(PingReplyEvent(None, conn=self,
contact=pingTo, seconds=timeDiff, control=control)) contact=pingTo, seconds=timeDiff, control=control))
if pingTo: if pingTo:
timePing = time_time() timePing = time.time()
self.connection.SendAndCallForResponse(iq, _on_response) self.connection.SendAndCallForResponse(iq, _on_response)
else: else:
self.connection.SendAndCallForResponse(iq, self._on_xmpp_ping_answer) self.connection.SendAndCallForResponse(iq, self._on_xmpp_ping_answer)