mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-25 04:02:46 +01:00
Made toggle require either #channel.op or admin capability.
This commit is contained in:
parent
5617dd6843
commit
cd4270942d
@ -44,6 +44,7 @@ import conf
|
|||||||
import debug
|
import debug
|
||||||
import utils
|
import utils
|
||||||
import world
|
import world
|
||||||
|
import ircdb
|
||||||
import ircutils
|
import ircutils
|
||||||
import privmsgs
|
import privmsgs
|
||||||
import callbacks
|
import callbacks
|
||||||
@ -259,8 +260,13 @@ class Toggleable(object):
|
|||||||
def toggle(self, irc, msg, args):
|
def toggle(self, irc, msg, args):
|
||||||
try:
|
try:
|
||||||
channel = privmsgs.getChannel(msg, args)
|
channel = privmsgs.getChannel(msg, args)
|
||||||
|
capability = ircdb.makeChannelCapability(channel, 'op')
|
||||||
except callbacks.Error:
|
except callbacks.Error:
|
||||||
channel = None
|
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)
|
(name, value) = privmsgs.getArgs(args, optional=1)
|
||||||
if not value:
|
if not value:
|
||||||
value = None
|
value = None
|
||||||
|
Loading…
Reference in New Issue
Block a user