mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Prevent nesting of Misc.tell
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
This commit is contained in:
parent
360a2036ac
commit
5b4c150d03
@ -381,6 +381,8 @@ class Misc(callbacks.Plugin):
|
|||||||
Tells the <nick> whatever <text> is. Use nested commands to your
|
Tells the <nick> whatever <text> is. Use nested commands to your
|
||||||
benefit here.
|
benefit here.
|
||||||
"""
|
"""
|
||||||
|
if irc.nested:
|
||||||
|
irc.error('This command cannot be nested.', Raise=True)
|
||||||
if target.lower() == 'me':
|
if target.lower() == 'me':
|
||||||
target = msg.nick
|
target = msg.nick
|
||||||
if ircutils.isChannel(target):
|
if ircutils.isChannel(target):
|
||||||
|
@ -142,6 +142,9 @@ class MiscTestCase(ChannelPluginTestCase):
|
|||||||
m = self.getMsg('tell me you love me')
|
m = self.getMsg('tell me you love me')
|
||||||
self.failUnless(m.args[0] == self.nick)
|
self.failUnless(m.args[0] == self.nick)
|
||||||
|
|
||||||
|
def testNoNestedTell(self):
|
||||||
|
self.assertRegexp('echo [tell %s foo]' % self.nick, 'nested')
|
||||||
|
|
||||||
def testTellDoesNotPropogateAction(self):
|
def testTellDoesNotPropogateAction(self):
|
||||||
m = self.getMsg('tell foo [action bar]')
|
m = self.getMsg('tell foo [action bar]')
|
||||||
self.failIf(ircmsgs.isAction(m))
|
self.failIf(ircmsgs.isAction(m))
|
||||||
|
Loading…
Reference in New Issue
Block a user