mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 11:42:51 +01:00
Merge bits of handle_server into ts6_common
This commit is contained in:
parent
d0f9a2465d
commit
6a5ca6b508
@ -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)."""
|
||||
|
@ -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
|
||||
|
@ -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."""
|
||||
|
Loading…
Reference in New Issue
Block a user