From 172f7bdd635fe20470fed08f6e936b61d5975b64 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 11 Mar 2015 15:51:47 -0700 Subject: [PATCH 1/2] Channel: allow devoicing self Voice almost always requires halfop or above to set, and since having (half)op gives greater access than voice, I don't see the benefit in restricting this when it won't make a difference anyways. --- plugins/Channel/plugin.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/plugins/Channel/plugin.py b/plugins/Channel/plugin.py index a9b404aa4..f60bd3b9a 100644 --- a/plugins/Channel/plugin.py +++ b/plugins/Channel/plugin.py @@ -259,10 +259,6 @@ class Channel(callbacks.Plugin): the nicks given. If no nicks are given, removes voice from the person 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) devoice = wrap(devoice, ['channel', ('haveOp', 'devoice someone'), any('nickInChannel')]) From d76b5049acf5281c9115cf2b8cec72ae8fa548ed Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 13 Mar 2015 23:37:29 -0700 Subject: [PATCH 2/2] Channel: update tests --- plugins/Channel/test.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/Channel/test.py b/plugins/Channel/test.py index 2ac9bc148..5addfd925 100644 --- a/plugins/Channel/test.py +++ b/plugins/Channel/test.py @@ -103,9 +103,13 @@ class ChannelTestCase(ChannelPluginTestCase): self.irc.feedMsg(ircmsgs.deop(self.channel, self.nick)) 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.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): self.assertError('op')