Made Sen case-insensitive (again...)

This commit is contained in:
Jeremy Fincher 2004-02-11 06:20:29 +00:00
parent 139e1bb614
commit cf1c3a84b9
2 changed files with 12 additions and 1 deletions

View File

@ -57,7 +57,17 @@ import privmsgs
import registry
import callbacks
def ircToLowerOrInt(x):
if isinstance(x, int):
return x
else:
return ircutils.toLower(x)
class IrcStringAndIntDict(utils.InsensitivePreservingDict):
key = staticmethod(ircToLowerOrInt)
class SeenDB(plugins.ChannelUserDB):
IdDict = IrcStringAndIntDict
def serialize(self, v):
return list(v)

View File

@ -161,6 +161,7 @@ class ChannelDBHandler(object):
class ChannelUserDictionary(UserDict.DictMixin):
IdDict = dict
def __init__(self):
self.channels = ircutils.IrcDict()
@ -169,7 +170,7 @@ class ChannelUserDictionary(UserDict.DictMixin):
def __setitem__(self, (channel, id), v):
if channel not in self.channels:
self.channels[channel] = {}
self.channels[channel] = self.IdDict()
self.channels[channel][id] = v
def __delitem__(self, (channel, id)):