Commit 395435c6 authored by ge0rg's avatar ge0rg Committed by Link Mauve

self-ping: add 'timeout' option for ping response

parent 0ee4bb61
......@@ -104,6 +104,7 @@ DEFAULT_CONFIG = {
'roster_sort': 'jid:show',
'save_status': True,
'self_ping_interval': 0,
'self_ping_timeout': 60,
'send_chat_states': True,
'send_initial_presence': True,
'send_os_info': True,
......
......@@ -1091,12 +1091,13 @@ class MucTab(ChatTab):
self.self_ping_event = None
def send_self_ping(self):
timeout = config.get_by_tabname("self_ping_timeout", self.general_jid, default=60)
to = self.name + "/" + self.own_nick
self.core.xmpp.plugin['xep_0199'].send_ping(
jid=to,
callback=self.on_self_ping_result,
timeout_callback=self.on_self_ping_failed,
timeout=60)
timeout=timeout)
def on_self_ping_result(self, iq):
if iq["type"] == "error" and iq["error"]["condition"] != "feature-not-implemented":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment