From edbfdd526d272c4fbb898042dac875d435fdcdee Mon Sep 17 00:00:00 2001 From: spline Date: Mon, 27 May 2013 18:12:35 -0400 Subject: [PATCH] Broke the code to check if isVoicePlus. Fixed in all 3 commands. --- plugin.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/plugin.py b/plugin.py index 48e4285..c5577a0 100644 --- a/plugin.py +++ b/plugin.py @@ -328,10 +328,11 @@ class Tweety(callbacks.Plugin): """ # enforce +voice or above to use command? - if self.registryValue('requireVoiceOrAbove', msg.args[0]): - if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they voice or op? - irc.error("ERROR: You have to be at least voiced to use the trends command in {0}.".format(msg.args[0])) - return + if self.registryValue('requireVoiceOrAbove', msg.args[0]): # should we check? + if ircutils.isChannel(msg.args[0]): # are we in a channel? + if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they + or @? + irc.error("ERROR: You have to be at least voiced to use the trends command in {0}.".format(msg.args[0])) + return # before we do anything, make sure we have a twitterApi object. if not self.twitterApi: @@ -390,10 +391,11 @@ class Tweety(callbacks.Plugin): """ # enforce +voice or above to use command? - if self.registryValue('requireVoiceOrAbove', msg.args[0]): - if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they voice or op? - irc.error("ERROR: You have to be at least voiced to use the tsearch command in {0}.".format(msg.args[0])) - return + if self.registryValue('requireVoiceOrAbove', msg.args[0]): # should we check? + if ircutils.isChannel(msg.args[0]): # are we in a channel? + if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they + or @? + irc.error("ERROR: You have to be at least voiced to use the tsearchcommand in {0}.".format(msg.args[0])) + return # before we do anything, make sure we have a twitterApi object. if not self.twitterApi: @@ -458,10 +460,11 @@ class Tweety(callbacks.Plugin): """ # enforce +voice or above to use command? - if self.registryValue('requireVoiceOrAbove', msg.args[0]): - if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they voice or op? - irc.error("ERROR: You have to be at least voiced to use the twitter command in {0}.".format(msg.args[0])) - return + if self.registryValue('requireVoiceOrAbove', msg.args[0]): # should we check? + if ircutils.isChannel(msg.args[0]): # are we in a channel? + if irc.state.channels[msg.args[0]].isVoicePlus(msg.nick): # are they + or @? + irc.error("ERROR: You have to be at least voiced to use the twitter command in {0}.".format(msg.args[0])) + return # before we do anything, make sure we have a twitterApi object. if not self.twitterApi: