self-ping: rename option from 'delay' to 'interval'

This commit is contained in:
Georg Lukas 2017-11-02 12:54:27 +01:00 committed by Emmanuel Gil Peyrot
parent 0fca40246b
commit 0ee4bb6129
2 changed files with 5 additions and 3 deletions

View file

@ -103,7 +103,7 @@ DEFAULT_CONFIG = {
'roster_show_offline': False,
'roster_sort': 'jid:show',
'save_status': True,
'self_ping_delay': 0,
'self_ping_interval': 0,
'send_chat_states': True,
'send_initial_presence': True,
'send_os_info': True,

View file

@ -1076,11 +1076,13 @@ class MucTab(ChatTab):
def enable_self_ping_event(self):
delay = config.get_by_tabname(
"self_ping_delay", self.general_jid, default=0)
if delay <= 0: # use 0 or some negative value to disable it
interval = int(config.get_by_tabname(
"self_ping_interval", self.general_jid, default=delay))
if interval <= 0: # use 0 or some negative value to disable it
return
self.disable_self_ping_event()
self.self_ping_event = timed_events.DelayedEvent(
delay, self.send_self_ping)
interval, self.send_self_ping)
self.core.add_timed_event(self.self_ping_event)
def disable_self_ping_event(self):