Only panic() when a server connection is part of bot init. closes #69

This commit is contained in:
jesopo 2019-06-17 14:20:11 +01:00
parent 0c02368023
commit 72ce880478
3 changed files with 6 additions and 3 deletions

View file

@ -145,7 +145,7 @@ class Module(ModuleManager.BaseModule):
def _panic(self, server, message):
message = "SASL panic for %s: %s" % (str(server), message)
if server.reconnected:
if not server.from_init:
self.log.error(message)
self.bot.disconnect(server)
else:

View file

@ -17,11 +17,13 @@ class Server(IRCObject.Object):
self.id = id
self.alias = alias
self.connection_params = connection_params
self.connected = False
self.reconnected = False
self.name = None # type: typing.Optional[str]
self.version = None # type: typing.Optional[str]
self.connected = False
self.reconnected = False
self.from_init = False
self.nickname = None # type: typing.Optional[str]
self.username = None # type: typing.Optional[str]
self.realname = None # type: typing.Optional[str]

View file

@ -92,6 +92,7 @@ if len(server_configs):
for server_id, alias in server_configs:
server = bot.add_server(server_id, connect=False)
if not server == None and server.get_setting("connect", True):
server.from_init = True
servers.append(server)
bot._events.on("boot.done").call()