From d0f9a2465db442242642419c78a278d0a54dfcf5 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 10 Aug 2017 19:42:04 -0700 Subject: [PATCH] Move handle_sid to ts6_common --- protocols/ts6.py | 9 --------- protocols/ts6_common.py | 10 ++++++++++ protocols/unreal.py | 8 -------- 3 files changed, 10 insertions(+), 17 deletions(-) diff --git a/protocols/ts6.py b/protocols/ts6.py index 2fbd147..98c5402 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -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, diff --git a/protocols/ts6_common.py b/protocols/ts6_common.py index 4a34d6f..64d69c7 100644 --- a/protocols/ts6_common.py +++ b/protocols/ts6_common.py @@ -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: diff --git a/protocols/unreal.py b/protocols/unreal.py index 5c6d9b5..94a56e1 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -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."""