summaryrefslogtreecommitdiff
path: root/sleekxmpp
diff options
context:
space:
mode:
Diffstat (limited to 'sleekxmpp')
-rw-r--r--sleekxmpp/plugins/xep_0199.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/sleekxmpp/plugins/xep_0199.py b/sleekxmpp/plugins/xep_0199.py
index 16e79e26..e7ec5c46 100644
--- a/sleekxmpp/plugins/xep_0199.py
+++ b/sleekxmpp/plugins/xep_0199.py
@@ -42,7 +42,7 @@ class xep_0199(base.base_plugin):
iq.attrib['to'] = xml.get('from', self.xmpp.boundjid.domain)
self.xmpp.send(iq)
- def sendPing(self, jid, timeout = 30):
+ def sendPing(self, jid, timeout = 30, errorfalse=False):
""" sendPing(jid, timeout)
Sends a ping to the specified jid, returning the time (in seconds)
to receive a reply, or None if no reply is received in timeout seconds.
@@ -57,7 +57,7 @@ class xep_0199(base.base_plugin):
#pingresult = self.xmpp.send(iq, self.xmpp.makeIq(id), timeout)
pingresult = iq.send()
endTime = time.clock()
- if pingresult == False:
+ if pingresult == False or (errorfalse and pingresult['type'] == 'error'):
#self.xmpp.disconnect(reconnect=True)
return False
return endTime - startTime