mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
Fixed bug #820262.
This commit is contained in:
parent
e903411ef3
commit
b0f5674f91
@ -67,7 +67,8 @@ def addressed(nick, msg):
|
||||
"""If msg is addressed to 'name', returns the portion after the address.
|
||||
Otherwise returns the empty string.
|
||||
"""
|
||||
if msg.args[0] == nick:
|
||||
nick = ircutils.toLower(nick)
|
||||
if ircutils.nickEqual(msg.args[0], nick):
|
||||
if msg.args[1][0] in conf.prefixChars:
|
||||
return msg.args[1][1:].strip()
|
||||
else:
|
||||
@ -77,7 +78,7 @@ def addressed(nick, msg):
|
||||
(maybeNick, rest) = msg.args[1].split(None, 1)
|
||||
while not ircutils.isNick(maybeNick):
|
||||
maybeNick = maybeNick[:-1]
|
||||
if maybeNick == nick:
|
||||
if ircutils.nickEqual(maybeNick, nick):
|
||||
return rest
|
||||
else:
|
||||
return ''
|
||||
|
@ -116,7 +116,8 @@ class FunctionsTestCase(unittest.TestCase):
|
||||
nick = 'supybot'
|
||||
conf.prefixChars = '~!@'
|
||||
inChannel = ['~foo', '@foo', '!foo',
|
||||
'%s: foo' % nick, '%s foo' % nick]
|
||||
'%s: foo' % nick, '%s foo' % nick,
|
||||
'%s: foo' % nick.capitalize(), '%s: foo' % nick.upper()]
|
||||
inChannel = [ircmsgs.privmsg('#foo', s) for s in inChannel]
|
||||
badmsg = ircmsgs.privmsg('#foo', '%s:foo' % nick)
|
||||
self.failIf(callbacks.addressed(nick, badmsg))
|
||||
|
Loading…
Reference in New Issue
Block a user