mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 19:19:32 +01:00
Made Sen case-insensitive (again...)
This commit is contained in:
parent
139e1bb614
commit
cf1c3a84b9
@ -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)
|
||||
|
||||
|
@ -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)):
|
||||
|
Loading…
Reference in New Issue
Block a user