Prevent nesting of Misc.tell

Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
James McCoy 2011-12-05 23:13:09 -05:00 committed by Valentin Lorentz
parent d1df9e8306
commit f0233c370f
2 changed files with 5 additions and 0 deletions

View File

@ -471,6 +471,8 @@ class Misc(callbacks.Plugin):
Tells the <nick> whatever <text> 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):

View File

@ -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))