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

Move handle_topic to IRCS2SProtocol

This commit is contained in:
James Lu 2017-07-05 00:48:58 -07:00
parent aa4e9335aa
commit db06ff4338
2 changed files with 13 additions and 14 deletions

View File

@ -590,6 +590,19 @@ class IRCS2SProtocol(IRCCommonProtocol):
self._remove_client(numeric) self._remove_client(numeric)
return {'text': args[0]} return {'text': args[0]}
def handle_topic(self, numeric, command, args):
"""Handles incoming TOPIC changes from clients."""
# <- :70MAAAAAA TOPIC #test :test
channel = self.to_lower(args[0])
topic = args[1]
oldtopic = self.channels[channel].topic
self.channels[channel].topic = topic
self.channels[channel].topicset = True
return {'channel': channel, 'setter': numeric, 'text': topic,
'oldtopic': oldtopic}
def handle_time(self, numeric, command, args): def handle_time(self, numeric, command, args):
"""Handles incoming /TIME requests.""" """Handles incoming /TIME requests."""
return {'target': args[0]} return {'target': args[0]}

View File

@ -235,20 +235,6 @@ class TS6BaseProtocol(IRCS2SProtocol):
return {'target': user, 'ts': 100, 'oldnick': oldnick} return {'target': user, 'ts': 100, 'oldnick': oldnick}
def handle_topic(self, numeric, command, args):
"""Handles incoming TOPIC changes from clients. For topic bursts,
TB (TS6/charybdis) and FTOPIC (InspIRCd) are used instead."""
# <- :70MAAAAAA TOPIC #test :test
channel = self.to_lower(args[0])
topic = args[1]
oldtopic = self.channels[channel].topic
self.channels[channel].topic = topic
self.channels[channel].topicset = True
return {'channel': channel, 'setter': numeric, 'text': topic,
'oldtopic': oldtopic}
def handle_svsnick(self, source, command, args): def handle_svsnick(self, source, command, args):
"""Handles SVSNICK (forced nickname change attempts).""" """Handles SVSNICK (forced nickname change attempts)."""
# InspIRCd: # InspIRCd: