mirror of
https://github.com/brmlab/brmdoor_libnfc.git
synced 2025-06-07 16:14:01 +02:00
Rejoin channels after reconnect
This commit is contained in:
parent
1394679dce
commit
bf5adab659
1 changed files with 8 additions and 0 deletions
|
@ -273,6 +273,14 @@ class IrcThread(threading.Thread):
|
||||||
reconnected = self.connect()
|
reconnected = self.connect()
|
||||||
logging.info("IRC reconnect attempt success: %s", reconnected)
|
logging.info("IRC reconnect attempt success: %s", reconnected)
|
||||||
self.setConnected(reconnected)
|
self.setConnected(reconnected)
|
||||||
|
if reconnected:
|
||||||
|
try:
|
||||||
|
logging.info("Rejoining channels: %s", self.channels)
|
||||||
|
for channel in self.channels:
|
||||||
|
self.connection.join(channel)
|
||||||
|
except:
|
||||||
|
logging.exception("Exception when rejoining channels")
|
||||||
|
|
||||||
|
|
||||||
def onJoin(self, connection, event):
|
def onJoin(self, connection, event):
|
||||||
""" Callback when channel is joined """
|
""" Callback when channel is joined """
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue