3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-26 02:10:39 +01:00

relay: enforce CLAIM checks in TOPIC too.

This commit is contained in:
James Lu 2015-09-13 14:23:27 -07:00
parent 9c4e0107f3
commit 19530107d7

View File

@ -707,7 +707,9 @@ utils.add_hook(handle_mode, 'MODE')
def handle_topic(irc, numeric, command, args): def handle_topic(irc, numeric, command, args):
channel = args['channel'] channel = args['channel']
oldtopic = args['oldtopic']
topic = args['topic'] topic = args['topic']
if checkClaim(irc, channel, numeric):
for name, remoteirc in world.networkobjects.items(): for name, remoteirc in world.networkobjects.items():
if irc.name == name or not remoteirc.connected.is_set(): if irc.name == name or not remoteirc.connected.is_set():
continue continue
@ -723,6 +725,9 @@ def handle_topic(irc, numeric, command, args):
else: else:
rsid = getRemoteSid(remoteirc, irc) rsid = getRemoteSid(remoteirc, irc)
remoteirc.proto.topicServer(rsid, remotechan, topic) remoteirc.proto.topicServer(rsid, remotechan, topic)
else: # Topic change blocked by claim.
irc.proto.topicClient(irc.pseudoclient.uid, channel, oldtopic)
utils.add_hook(handle_topic, 'TOPIC') utils.add_hook(handle_topic, 'TOPIC')
def handle_kill(irc, numeric, command, args): def handle_kill(irc, numeric, command, args):