Use CAPAB IDENTIFY-MSG to validate bot operators
[people/stefanha/gpxebot.git] / cmds.py
diff --git a/cmds.py b/cmds.py
index 7d0d164..ac85da5 100644 (file)
--- a/cmds.py
+++ b/cmds.py
@@ -93,7 +93,7 @@ def help_command(who, _, replyto, msg):
                 output.append(('PRIVMSG', (replyto, '%s    %s' % (name.ljust(max_width), cmd.__doc__))))
         return output
     output = do_help(commands)
-    if utils.nick_from_mask(who) in op_members:
+    if who.is_op():
         output.extend(do_help(op_commands))
     return output
 commands['help'] = help_command
@@ -155,7 +155,7 @@ def privmsg_command(who, target, replyto, words):
     '''Send a chat message (privmsg #etherboot Hello all!)'''
     if len(words) < 3:
         return
-    return ('PRIVMSG', (words[1], ' '.join(words[2:])))
+    return 'PRIVMSG', (words[1], ' '.join(words[2:]))
 op_commands['privmsg'] = privmsg_command
 
 def restart_command(who, target, replyto, words):
@@ -168,7 +168,7 @@ def do_command(who, target, replyto, words):
         return
     command = words[0].lower()
 
-    if utils.nick_from_mask(who) in op_members and command in op_commands:
+    if who.is_op() and command in op_commands:
         return op_commands[command](who, target, replyto, words)
     if command in commands:
         return commands[command](who, target, replyto, words)