3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-26 04:32:51 +01:00

protocols: remove unnecessary handle_squit overrides

This commit is contained in:
James Lu 2017-07-02 22:20:52 -07:00
parent d4260734dc
commit e9a6328566
2 changed files with 3 additions and 13 deletions

View File

@ -147,6 +147,9 @@ class IRCS2SProtocol(IRCCommonProtocol):
self.protocol_caps = {'can-spawn-clients', 'has-ts', 'can-host-relay', self.protocol_caps = {'can-spawn-clients', 'has-ts', 'can-host-relay',
'can-track-servers'} 'can-track-servers'}
# Alias
self.handle_squit = self._squit
def handle_events(self, data): def handle_events(self, data):
"""Event handler for RFC1459-like protocols. """Event handler for RFC1459-like protocols.
@ -353,10 +356,6 @@ class IRCS2SProtocol(IRCCommonProtocol):
self._remove_client(numeric) self._remove_client(numeric)
return {'text': args[0]} return {'text': args[0]}
def handle_squit(self, numeric, command, args):
"""Handles incoming SQUITs."""
return self._squit(numeric, command, args)
def handle_time(self, numeric, command, args): def handle_time(self, numeric, command, args):
"""Handles incoming /TIME requests.""" """Handles incoming /TIME requests."""
return {'target': args[0]} return {'target': args[0]}

View File

@ -506,15 +506,6 @@ class UnrealProtocol(TS6BaseProtocol):
sdesc = args[-1] sdesc = args[-1]
self.servers[sid] = Server(numeric, sname, desc=sdesc) self.servers[sid] = Server(numeric, sname, desc=sdesc)
return {'name': sname, 'sid': sid, 'text': sdesc} return {'name': sname, 'sid': sid, 'text': sdesc}
def handle_squit(self, numeric, command, args):
"""Handles the SQUIT command."""
# <- SQUIT services.int :Read error
# Convert the server name to a SID...
args[0] = self._get_SID(args[0])
# Then, use the SQUIT handler in TS6BaseProtocol as usual.
return super().handle_squit(numeric, 'SQUIT', args)
def handle_protoctl(self, numeric, command, args): def handle_protoctl(self, numeric, command, args):
"""Handles protocol negotiation.""" """Handles protocol negotiation."""