From 5b4c150d037ddfcd7358e00850178a4b60fd44b8 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 5 Dec 2011 23:13:09 -0500 Subject: [PATCH] Prevent nesting of Misc.tell Signed-off-by: James McCoy --- plugins/Misc/plugin.py | 2 ++ plugins/Misc/test.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/plugins/Misc/plugin.py b/plugins/Misc/plugin.py index 702a70b3b..4ed95f50d 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -381,6 +381,8 @@ class Misc(callbacks.Plugin): Tells the whatever is. Use nested commands to your benefit here. """ + if irc.nested: + irc.error('This command cannot be nested.', Raise=True) if target.lower() == 'me': target = msg.nick if ircutils.isChannel(target): diff --git a/plugins/Misc/test.py b/plugins/Misc/test.py index bf7948dbd..1f379263b 100644 --- a/plugins/Misc/test.py +++ b/plugins/Misc/test.py @@ -142,6 +142,9 @@ class MiscTestCase(ChannelPluginTestCase): m = self.getMsg('tell me you love me') self.failUnless(m.args[0] == self.nick) + def testNoNestedTell(self): + self.assertRegexp('echo [tell %s foo]' % self.nick, 'nested') + def testTellDoesNotPropogateAction(self): m = self.getMsg('tell foo [action bar]') self.failIf(ircmsgs.isAction(m))