Fix a reconnecting regression
This commit is contained in:
parent
33a9780d97
commit
0ff3f9754b
23
hybridbot.py
23
hybridbot.py
@ -135,15 +135,22 @@ class XMPPBot:
|
||||
def connect(self):
|
||||
self.client.connect()
|
||||
|
||||
@asyncio.coroutine
|
||||
def join_muc_loop(self):
|
||||
muc_plugin = self.client.plugin['xep_0045']
|
||||
while not self.muc_is_joined:
|
||||
muc_plugin.join_muc(self.muc, self.nick)
|
||||
yield from asyncio.sleep(self.timeout)
|
||||
|
||||
def join_muc(self):
|
||||
asyncio.async(self.join_muc_loop())
|
||||
muc_plugin = self.client.plugin['xep_0045']
|
||||
@asyncio.coroutine
|
||||
def loop_cycle():
|
||||
if self._join_muc_block > 0:
|
||||
return
|
||||
self._join_muc_block += 1
|
||||
|
||||
while not self.muc_is_joined:
|
||||
muc_plugin.join_muc(self.muc, self.nick)
|
||||
yield from asyncio.sleep(self.timeout)
|
||||
|
||||
self._join_muc_block -= 1
|
||||
|
||||
asyncio.async(loop_cycle())
|
||||
_join_muc_block = 0
|
||||
|
||||
def on_failed_all_auth(event):
|
||||
# print('could not connect!', file=sys.stderr)
|
||||
|
Loading…
Reference in New Issue
Block a user