3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 19:52:53 +01:00

ts6: add stub for legacy (no SID) SERVER introduction

This commit is contained in:
James Lu 2015-10-09 22:48:31 -07:00
parent f80b383d06
commit 64cba70cbd

View File

@ -588,22 +588,23 @@ class TS6Protocol(TS6BaseProtocol):
raise ProtocolError("Servers should use EUID instead of UID to send users! "
"This IS a required capability after all...")
def handle_server(self, numeric, command, args):
"""Handles incoming SERVER introductions."""
def handle_sid(self, numeric, command, args):
"""Handles incoming server introductions."""
# parameters: server name, hopcount, sid, server description
servername = args[0].lower()
try:
sid = args[2]
except IndexError:
# It is allowed to send JUPEd servers that exist without a SID.
# That's not very fun to handle, though.
# XXX: don't just save these by their server names; that's ugly!
sid = servername
sid = args[2]
sdesc = args[-1]
self.irc.servers[sid] = IrcServer(numeric, servername, desc=sdesc)
return {'name': servername, 'sid': sid, 'text': sdesc}
handle_sid = handle_server
def handle_server(self, numeric, command, args):
"""Handles incoming legacy (no SID) server introductions."""
# <- :services.int SERVER a.bc 2 :(H) [GL] a
raise NotImplementedError
servername = args[0].lower()
sdesc = args[-1]
self.irc.servers[servername] = IrcServer(numeric, servername, desc=sdesc)
return {'name': servername, 'sid': sid, 'text': sdesc}
def handle_tmode(self, numeric, command, args):
"""Handles incoming TMODE commands (channel mode change)."""