From cd4270942dba7e0e972bd7a70f4073f79062fd06 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 29 Oct 2003 00:13:43 +0000 Subject: [PATCH] Made toggle require either #channel.op or admin capability. --- src/plugins.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins.py b/src/plugins.py index 0e8a41a63..6728e4442 100644 --- a/src/plugins.py +++ b/src/plugins.py @@ -44,6 +44,7 @@ import conf import debug import utils import world +import ircdb import ircutils import privmsgs import callbacks @@ -259,8 +260,13 @@ class Toggleable(object): def toggle(self, irc, msg, args): try: channel = privmsgs.getChannel(msg, args) + capability = ircdb.makeChannelCapability(channel, 'op') except callbacks.Error: channel = None + capability = 'admin' + if not ircdb.checkCapability(msg.prefix, capability): + irc.error(msg, conf.replyNoCapability % capability) + return (name, value) = privmsgs.getArgs(args, optional=1) if not value: value = None