mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-12 13:12:35 +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.
|
"""If msg is addressed to 'name', returns the portion after the address.
|
||||||
Otherwise returns the empty string.
|
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:
|
if msg.args[1][0] in conf.prefixChars:
|
||||||
return msg.args[1][1:].strip()
|
return msg.args[1][1:].strip()
|
||||||
else:
|
else:
|
||||||
@ -77,7 +78,7 @@ def addressed(nick, msg):
|
|||||||
(maybeNick, rest) = msg.args[1].split(None, 1)
|
(maybeNick, rest) = msg.args[1].split(None, 1)
|
||||||
while not ircutils.isNick(maybeNick):
|
while not ircutils.isNick(maybeNick):
|
||||||
maybeNick = maybeNick[:-1]
|
maybeNick = maybeNick[:-1]
|
||||||
if maybeNick == nick:
|
if ircutils.nickEqual(maybeNick, nick):
|
||||||
return rest
|
return rest
|
||||||
else:
|
else:
|
||||||
return ''
|
return ''
|
||||||
|
@ -116,7 +116,8 @@ class FunctionsTestCase(unittest.TestCase):
|
|||||||
nick = 'supybot'
|
nick = 'supybot'
|
||||||
conf.prefixChars = '~!@'
|
conf.prefixChars = '~!@'
|
||||||
inChannel = ['~foo', '@foo', '!foo',
|
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]
|
inChannel = [ircmsgs.privmsg('#foo', s) for s in inChannel]
|
||||||
badmsg = ircmsgs.privmsg('#foo', '%s:foo' % nick)
|
badmsg = ircmsgs.privmsg('#foo', '%s:foo' % nick)
|
||||||
self.failIf(callbacks.addressed(nick, badmsg))
|
self.failIf(callbacks.addressed(nick, badmsg))
|
||||||
|
Loading…
Reference in New Issue
Block a user