mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Prevent nesting of Misc.tell
Signed-off-by: James McCoy <jamessan@users.sourceforge.net>
(cherry picked from commit 5b4c150d03
)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This commit is contained in:
parent
63ec70bc08
commit
bcdc8ecb00
@ -404,6 +404,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