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

Merge bits of handle_server into ts6_common

This commit is contained in:
James Lu 2017-08-10 19:50:32 -07:00
parent d0f9a2465d
commit 6a5ca6b508
3 changed files with 10 additions and 8 deletions

View File

@ -584,10 +584,7 @@ class TS6Protocol(TS6BaseProtocol):
return
# <- :services.int SERVER a.bc 2 :(H) [GL] a
servername = args[0].lower()
sdesc = args[-1]
self.servers[servername] = Server(numeric, servername, desc=sdesc)
return {'name': servername, 'sid': None, 'text': sdesc}
return super().handle_server(numeric, command, args)
def handle_tmode(self, numeric, command, args):
"""Handles incoming TMODE commands (channel mode change)."""

View File

@ -227,6 +227,14 @@ class TS6BaseProtocol(IRCS2SProtocol):
return {'target': user, 'ts': 100, 'oldnick': oldnick}
def handle_server(self, numeric, command, args):
"""Handles the SERVER command, used for introducing older (TS5) servers."""
# <- :services.int SERVER a.bc 2 :(H) [GL] test jupe
servername = args[0].lower()
sdesc = args[-1]
self.servers[servername] = Server(numeric, servername, desc=sdesc)
return {'name': servername, 'sid': None, 'text': sdesc}
def handle_sid(self, numeric, command, args):
"""Handles the SID command, used for introducing remote servers by our uplink."""
# <- SID services.int 2 00A :Shaltúre IRC Services

View File

@ -486,10 +486,7 @@ class UnrealProtocol(TS6BaseProtocol):
else:
# Legacy (non-SID) servers can still be introduced using the SERVER command.
# <- :services.int SERVER a.bc 2 :(H) [GL] a
servername = args[0].lower()
sdesc = args[-1]
self.servers[servername] = Server(numeric, servername, desc=sdesc)
return {'name': servername, 'sid': None, 'text': sdesc}
return super().handle_server(numeric, command, args)
def handle_protoctl(self, numeric, command, args):
"""Handles protocol negotiation."""