3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-24 19:24:13 +01:00

relay: fix clientbot op requirement not being checked if the sender is in the target channel

Also, show a slightly different error when using the command with 'remote', since the clientbot client gets overridden to be the message sender.

This mirrors the fix in 1.x: commit 9578fd5ac3
This commit is contained in:
James Lu 2018-06-07 13:34:52 -07:00
parent 5b94a10c67
commit fee64ece04

View File

@ -2269,14 +2269,17 @@ def link(irc, source, args):
irc.join(irc.pseudoclient.uid, localchan)
irc.reply('Joining %r now to check for op status; please run this command again after I join.' % localchan)
return
elif not irc.channels[localchan].is_op_plus(source):
irc.error('You must be opped in %r to complete this operation.' % localchan)
return
else:
irc.error('You must be in %r to complete this operation.' % localchan)
return
elif not irc.channels[localchan].is_op_plus(source):
if irc.pseudoclient and source == irc.pseudoclient.uid:
irc.error('Please op the bot in %r to complete this operation.' % localchan)
else:
irc.error('You must be opped in %r to complete this operation.' % localchan)
return
permissions.check_permissions(irc, source, ['relay.link'])
if remotenet not in world.networkobjects: