Finally found the underlying cause of the relaynames bug.

This commit is contained in:
Jeremy Fincher 2003-06-04 03:56:59 +00:00
parent 82bb295b20
commit f2ae4b5f34
3 changed files with 11 additions and 1 deletions

View File

@ -296,7 +296,7 @@ class IrcState(IrcCommandDispatcher):
chan.topic = msg.args[2]
def doNick(self, irc, msg):
newNick = msg.args[0]
newNick = nick(msg.args[0])
oldNick = msg.nick
try:
if msg.user and msg.host:

View File

@ -79,7 +79,10 @@ class IrcMsg(object):
self._user = user
self._host = host
self._command = command
if self.command == 'NICK':
self._args[0] = ircutils.nick(self._args[0])
self._args = tuple(args)
prefix = property(lambda self: self._prefix)
nick = property(lambda self: self._nick)

View File

@ -235,8 +235,15 @@ def shrinkList(L, sep='', limit=425):
class nick(str):
"""This class does case-insensitive comparisons of nicks."""
def __init__(self, s):
self.original = s
self.lowered = toLower(s)
def __repr__(self):
return repr(self.original)
def __str__(self):
return str(self.original)
def __eq__(self, s):
try:
return toLower(s) == self.lowered