From fee64ece045ad9dc49a07d1b438caa019c90a778 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 7 Jun 2018 13:34:52 -0700 Subject: [PATCH] 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 9578fd5ac306866f3535ee1cf9c5a7e241fc4511 --- plugins/relay.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index c7f44e5..fe5d870 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -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: