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

protocols: in TOPIC hooks, send the topic as keyword "text" instead of keyword "topic"

This is just to be more consistent, as other hooks usually use "text" for text fields.
This commit is contained in:
James Lu 2015-12-18 21:53:35 -08:00
parent d0436b9f4d
commit 349cff36e1
5 changed files with 5 additions and 5 deletions

View File

@ -917,7 +917,7 @@ utils.add_hook(handle_mode, 'MODE')
def handle_topic(irc, numeric, command, args):
channel = args['channel']
oldtopic = args.get('oldtopic')
topic = args['topic']
topic = args['text']
if checkClaim(irc, channel, numeric):
for name, remoteirc in world.networkobjects.items():
if irc.name == name or not remoteirc.connected.is_set():

View File

@ -514,7 +514,7 @@ class InspIRCdProtocol(TS6BaseProtocol):
topic = args[-1]
self.irc.channels[channel].topic = topic
self.irc.channels[channel].topicset = True
return {'channel': channel, 'setter': setter, 'ts': ts, 'topic': topic}
return {'channel': channel, 'setter': setter, 'ts': ts, 'text': topic}
# SVSTOPIC is used by InspIRCd module m_topiclock - its arguments are the same as FTOPIC
handle_svstopic = handle_ftopic

View File

@ -576,7 +576,7 @@ class TS6Protocol(TS6BaseProtocol):
topic = args[-1]
self.irc.channels[channel].topic = topic
self.irc.channels[channel].topicset = True
return {'channel': channel, 'setter': setter, 'ts': ts, 'topic': topic}
return {'channel': channel, 'setter': setter, 'ts': ts, 'text': topic}
def handle_invite(self, numeric, command, args):
"""Handles incoming INVITEs."""

View File

@ -253,7 +253,7 @@ class TS6BaseProtocol(Protocol):
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, 'topic': topic,
return {'channel': channel, 'setter': numeric, 'ts': ts, 'text': topic,
'oldtopic': oldtopic}
def handle_part(self, source, command, args):

View File

@ -633,7 +633,7 @@ class UnrealProtocol(TS6BaseProtocol):
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, 'topic': topic,
return {'channel': channel, 'setter': numeric, 'ts': ts, 'text': topic,
'oldtopic': oldtopic}
def handle_whois(self, numeric, command, args):