irclib: handle disconnections correctly for InspIRCd 2.0 networks

The old code, which checked for "Closing Link" in the message, wouldn't have matched InspIRCd's way of closing connections (they send "Closing link" with a lowercase l):

DEBUG 2015-09-27T19:15:32 Incoming message (overdrive-irc): ERROR :Closing link: (LilyBot@0::1) [Quit: test]
This commit is contained in:
James Lu 2015-09-27 19:18:15 -07:00
parent 532309ecff
commit 1168b4d0b7

View File

@ -1278,7 +1278,7 @@ class Irc(IrcCommandDispatcher, log.Firewalled):
"""Handles ERROR messages.""" """Handles ERROR messages."""
log.warning('Error message from %s: %s', self.network, msg.args[0]) log.warning('Error message from %s: %s', self.network, msg.args[0])
if not self.zombie: if not self.zombie:
if msg.args[0].startswith('Closing Link'): if msg.args[0].lower().startswith('closing link'):
self.driver.reconnect() self.driver.reconnect()
elif 'too fast' in msg.args[0]: # Connecting too fast. elif 'too fast' in msg.args[0]: # Connecting too fast.
self.driver.reconnect(wait=True) self.driver.reconnect(wait=True)