From f0233c370f67c8cce40efe3be000db9495375290 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 b95a84565..66e072c24 100644 --- a/plugins/Misc/plugin.py +++ b/plugins/Misc/plugin.py @@ -471,6 +471,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 7105d9414..985f001a1 100644 --- a/plugins/Misc/test.py +++ b/plugins/Misc/test.py @@ -148,6 +148,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))