Remove some legacy code
This commit is contained in:
34
core/bot.py
34
core/bot.py
@@ -731,9 +731,8 @@ class IRCBotFactory(ReconnectingClientFactory):
|
||||
self.relayCommands, self.user, self.stage2 = relayCommands, user, stage2
|
||||
|
||||
def buildProtocol(self, addr):
|
||||
if self.relay is False:
|
||||
entry = IRCBot(self.net, self.num)
|
||||
main.IRCPool[self.name] = entry
|
||||
entry = IRCBot(self.net, self.num)
|
||||
main.IRCPool[self.name] = entry
|
||||
|
||||
self.client = entry
|
||||
return entry
|
||||
@@ -746,21 +745,20 @@ class IRCBotFactory(ReconnectingClientFactory):
|
||||
self.client.authenticated = False
|
||||
self.client.channels = []
|
||||
error = reason.getErrorMessage()
|
||||
if not self.relay:
|
||||
log("%s - %i: connection lost: %s" % (self.net, self.num, error))
|
||||
sendAll("%s - %i: connection lost: %s" % (self.net, self.num, error))
|
||||
ctime = str(datetime.now().isoformat())
|
||||
sendRelayNotification(
|
||||
{
|
||||
"type": "conn",
|
||||
"net": self.net,
|
||||
"num": self.num,
|
||||
"status": "lost",
|
||||
"message": error,
|
||||
"ts": ctime,
|
||||
}
|
||||
)
|
||||
self.retry(connector)
|
||||
log("%s - %i: connection lost: %s" % (self.net, self.num, error))
|
||||
sendAll("%s - %i: connection lost: %s" % (self.net, self.num, error))
|
||||
ctime = str(datetime.now().isoformat())
|
||||
sendRelayNotification(
|
||||
{
|
||||
"type": "conn",
|
||||
"net": self.net,
|
||||
"num": self.num,
|
||||
"status": "lost",
|
||||
"message": error,
|
||||
"ts": ctime,
|
||||
}
|
||||
)
|
||||
self.retry(connector)
|
||||
# ReconnectingClientFactory.clientConnectionLost(self, connector, reason)
|
||||
|
||||
def clientConnectionFailed(self, connector, reason):
|
||||
|
||||
Reference in New Issue
Block a user