mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-10-18 18:07:25 +02:00
Channel: Add capability checks in @voice
This commit is contained in:
parent
945b34d519
commit
06832d6e3a
@ -242,11 +242,21 @@ class Channel(callbacks.Plugin):
|
|||||||
irc.error(_('I cowardly refuse to devoice myself. If you really '
|
irc.error(_('I cowardly refuse to devoice myself. If you really '
|
||||||
'want me devoiced, tell me to op you and then devoice '
|
'want me devoiced, tell me to op you and then devoice '
|
||||||
'me yourself.'), Raise=True)
|
'me yourself.'), Raise=True)
|
||||||
if not nicks:
|
if nicks:
|
||||||
|
if len(nicks) == 1 and msg.nick in nicks:
|
||||||
|
capability = 'voice'
|
||||||
|
else:
|
||||||
|
capability = 'op'
|
||||||
|
else:
|
||||||
nicks = [msg.nick]
|
nicks = [msg.nick]
|
||||||
|
capability = 'voice'
|
||||||
|
capability = ircdb.makeChannelCapability(channel, capability)
|
||||||
|
if ircdb.checkCapability(msg.prefix, capability):
|
||||||
def f(L):
|
def f(L):
|
||||||
return ircmsgs.devoices(channel, L)
|
return ircmsgs.devoices(channel, L)
|
||||||
self._sendMsgs(irc, nicks, f)
|
self._sendMsgs(irc, nicks, f)
|
||||||
|
else:
|
||||||
|
irc.errorNoCapability(capability)
|
||||||
devoice = wrap(devoice, ['voice', ('isGranted', 'devoice someone'),
|
devoice = wrap(devoice, ['voice', ('isGranted', 'devoice someone'),
|
||||||
any('nickInChannel')])
|
any('nickInChannel')])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user