3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

Move handle_sid to ts6_common

This commit is contained in:
James Lu 2017-08-10 19:42:04 -07:00
parent 614b8b87da
commit d0f9a2465d
3 changed files with 10 additions and 17 deletions

View File

@ -564,15 +564,6 @@ class TS6Protocol(TS6BaseProtocol):
return self.handle_euid(numeric, command, euid_args)
def handle_sid(self, numeric, command, args):
"""Handles incoming server introductions."""
# parameters: server name, hopcount, sid, server description
servername = args[0].lower()
sid = args[2]
sdesc = args[-1]
self.servers[sid] = Server(numeric, servername, desc=sdesc)
return {'name': servername, 'sid': sid, 'text': sdesc}
def handle_server(self, numeric, command, args):
"""
Handles 1) incoming legacy (no SID) server introductions,

View File

@ -227,6 +227,16 @@ class TS6BaseProtocol(IRCS2SProtocol):
return {'target': user, 'ts': 100, 'oldnick': oldnick}
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
# parameters: server name, hopcount, sid, server description
sname = args[0].lower()
sid = args[2]
sdesc = args[-1]
self.servers[sid] = Server(numeric, sname, desc=sdesc)
return {'name': sname, 'sid': sid, 'text': sdesc}
def handle_svsnick(self, source, command, args):
"""Handles SVSNICK (forced nickname change attempts)."""
# InspIRCd:

View File

@ -491,14 +491,6 @@ class UnrealProtocol(TS6BaseProtocol):
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
sname = args[0].lower()
sid = args[2]
sdesc = args[-1]
self.servers[sid] = Server(numeric, sname, desc=sdesc)
return {'name': sname, 'sid': sid, 'text': sdesc}
def handle_protoctl(self, numeric, command, args):
"""Handles protocol negotiation."""