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

protocols: record the right sender in TOPIC handlers (first part of #127)

This commit is contained in:
James Lu 2016-01-09 20:50:38 -08:00
parent f5a828c4af
commit ff6841c551
2 changed files with 8 additions and 3 deletions

View File

@ -257,11 +257,12 @@ class TS6BaseProtocol(Protocol):
# <- :70MAAAAAA TOPIC #test :test
channel = utils.toLower(self.irc, args[0])
topic = args[1]
ts = int(time.time())
oldtopic = self.irc.channels[channel].topic
self.irc.channels[channel].topic = topic
self.irc.channels[channel].topicset = True
return {'channel': channel, 'setter': numeric, 'ts': ts, 'text': topic,
return {'channel': channel, 'setter': numeric, 'text': topic,
'oldtopic': oldtopic}
def handle_part(self, source, command, args):

View File

@ -715,13 +715,17 @@ class UnrealProtocol(TS6BaseProtocol):
def handle_topic(self, numeric, command, args):
"""Handles the TOPIC command."""
# <- GL TOPIC #services GL 1444699395 :weeee
# <- TOPIC #services devel.relay 1452399682 :test
channel = utils.toLower(self.irc, args[0])
topic = args[-1]
setter = args[1]
ts = args[2]
oldtopic = self.irc.channels[channel].topic
self.irc.channels[channel].topic = topic
self.irc.channels[channel].topicset = True
return {'channel': channel, 'setter': numeric, 'ts': ts, 'text': topic,
return {'channel': channel, 'setter': setter, 'ts': ts, 'text': topic,
'oldtopic': oldtopic}
def handle_whois(self, numeric, command, args):