mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 18:44:04 +01:00
Merge pull request #1078 from GLolol/channel/allow-devoice-self
Channel: allow devoicing self
This commit is contained in:
commit
381e514b5c
@ -259,10 +259,6 @@ class Channel(callbacks.Plugin):
|
|||||||
the nicks given. If no nicks are given, removes voice from the person
|
the nicks given. If no nicks are given, removes voice from the person
|
||||||
sending the message.
|
sending the message.
|
||||||
"""
|
"""
|
||||||
if irc.nick in nicks:
|
|
||||||
irc.error(_('I cowardly refuse to devoice myself. If you really '
|
|
||||||
'want me devoiced, tell me to op you and then devoice '
|
|
||||||
'me yourself.'), Raise=True)
|
|
||||||
self._voice(irc, msg, args, channel, nicks, ircmsgs.devoices)
|
self._voice(irc, msg, args, channel, nicks, ircmsgs.devoices)
|
||||||
devoice = wrap(devoice, ['channel', ('haveOp', 'devoice someone'),
|
devoice = wrap(devoice, ['channel', ('haveOp', 'devoice someone'),
|
||||||
any('nickInChannel')])
|
any('nickInChannel')])
|
||||||
|
@ -103,9 +103,13 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
self.irc.feedMsg(ircmsgs.deop(self.channel, self.nick))
|
self.irc.feedMsg(ircmsgs.deop(self.channel, self.nick))
|
||||||
|
|
||||||
def testWontDeItself(self):
|
def testWontDeItself(self):
|
||||||
for s in 'deop dehalfop devoice'.split():
|
for s in 'deop dehalfop'.split():
|
||||||
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
||||||
self.assertError('%s %s' % (s, self.nick))
|
self.assertError('%s %s' % (s, self.nick))
|
||||||
|
|
||||||
|
def testCanDevoiceSelf(self):
|
||||||
|
self.irc.feedMsg(ircmsgs.op(self.channel, self.nick))
|
||||||
|
self.assertNotError('devoice %s' % self.nick)
|
||||||
|
|
||||||
def testOp(self):
|
def testOp(self):
|
||||||
self.assertError('op')
|
self.assertError('op')
|
||||||
|
Loading…
Reference in New Issue
Block a user