Fix a reconnecting regression
Este commit está contenido en:
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)
|
||||
|
||||
Referencia en una nueva incidencia
Block a user