3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-23 19:19:31 +01:00

Move handle_error() to the generic protocol

This commit is contained in:
James Lu 2016-08-08 18:12:07 -07:00
parent 73a70d6952
commit 12e1a0edff
2 changed files with 5 additions and 5 deletions

View File

@ -1359,3 +1359,8 @@ class Protocol():
"""
prefixsearch = re.search(r'\(([A-Za-z]+)\)(.*)', args)
return dict(zip(prefixsearch.group(1), prefixsearch.group(2)))
def handle_error(self, numeric, command, args):
"""Handles ERROR messages - these mean that our uplink has disconnected us!"""
self.irc.connected.clear()
raise ProtocolError('Received an ERROR, disconnecting!')

View File

@ -374,11 +374,6 @@ class TS6BaseProtocol(IRCS2SProtocol):
self.handle_part(kicked, 'KICK', [channel, args[2]])
return {'channel': channel, 'target': kicked, 'text': args[2]}
def handle_error(self, numeric, command, args):
"""Handles ERROR messages - these mean that our uplink has disconnected us!"""
self.irc.connected.clear()
raise ProtocolError('Received an ERROR, disconnecting!')
def handle_nick(self, numeric, command, args):
"""Handles incoming NICK changes."""
# <- :70MAAAAAA NICK GL-devel 1434744242