3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 20:22:45 +01:00

relay: Don't allow kicks/parts to the PyLink client to be relayed.

This commit is contained in:
James Lu 2015-08-15 06:05:12 -07:00
parent 6ebe6e7867
commit a1db4932e1

View File

@ -293,6 +293,9 @@ utils.add_hook(handle_nick, 'NICK')
def handle_part(irc, numeric, command, args): def handle_part(irc, numeric, command, args):
channels = args['channels'] channels = args['channels']
text = args['text'] text = args['text']
# Don't allow the PyLink client PARTing to be relayed.
if numeric == irc.pseudoclient.uid:
return
for channel in channels: for channel in channels:
for netname, user in relayusers[(irc.name, numeric)].copy().items(): for netname, user in relayusers[(irc.name, numeric)].copy().items():
remoteirc = utils.networkobjects[netname] remoteirc = utils.networkobjects[netname]
@ -370,7 +373,8 @@ def handle_kick(irc, source, command, args):
kicker = source kicker = source
kicker_modes = getPrefixModes(irc, irc, channel, kicker) kicker_modes = getPrefixModes(irc, irc, channel, kicker)
relay = findRelay((irc.name, channel)) relay = findRelay((irc.name, channel))
if relay is None: # Don't allow kicks to the PyLink client to be relayed.
if relay is None or target == irc.pseudoclient.uid:
return return
for name, remoteirc in utils.networkobjects.items(): for name, remoteirc in utils.networkobjects.items():
if irc.name == name or not remoteirc.connected.is_set(): if irc.name == name or not remoteirc.connected.is_set():