From 9578fd5ac306866f3535ee1cf9c5a7e241fc4511 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 7 Jun 2018 13:19:53 -0700 Subject: [PATCH] relay: fix clientbot op requirement not being checked if the sender is in the target channel --- plugins/relay.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index da841c1..d14738c 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -1785,13 +1785,16 @@ def link(irc, source, args): irc.proto.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].isOpPlus(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].isOpPlus(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.checkPermissions(irc, source, ['relay.link'])