Added special 'me' handling to tell.

This commit is contained in:
Jeremy Fincher 2004-01-15 17:21:06 +00:00
parent 83cc3132ba
commit fd294faeee
2 changed files with 4 additions and 0 deletions

View File

@ -429,6 +429,8 @@ class Misc(callbacks.Privmsg):
your benefit here.
"""
(target, text) = privmsgs.getArgs(args, required=2)
if target.lower() == 'me':
target = msg.nick
if not ircutils.isNick(target) and not ircutils.isChannel(target):
irc.error('%s is not a valid nick or channel.' % target)
return

View File

@ -135,6 +135,8 @@ class MiscTestCase(ChannelPluginTestCase, PluginDocumentation):
m = self.getMsg('tell #foo [plugin tell]')
self.failUnless(m.args[0] == '#foo')
self.failUnless('Misc' in m.args[1])
m = self.getMsg('tell me you love me')
self.failUnless(m.args[0] == self.nick)
def testLast(self):
self.feedMsg('foo bar baz')