mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-17 06:00:42 +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 registry
|
||||||
import callbacks
|
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):
|
class SeenDB(plugins.ChannelUserDB):
|
||||||
|
IdDict = IrcStringAndIntDict
|
||||||
def serialize(self, v):
|
def serialize(self, v):
|
||||||
return list(v)
|
return list(v)
|
||||||
|
|
||||||
|
@ -161,6 +161,7 @@ class ChannelDBHandler(object):
|
|||||||
|
|
||||||
|
|
||||||
class ChannelUserDictionary(UserDict.DictMixin):
|
class ChannelUserDictionary(UserDict.DictMixin):
|
||||||
|
IdDict = dict
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.channels = ircutils.IrcDict()
|
self.channels = ircutils.IrcDict()
|
||||||
|
|
||||||
@ -169,7 +170,7 @@ class ChannelUserDictionary(UserDict.DictMixin):
|
|||||||
|
|
||||||
def __setitem__(self, (channel, id), v):
|
def __setitem__(self, (channel, id), v):
|
||||||
if channel not in self.channels:
|
if channel not in self.channels:
|
||||||
self.channels[channel] = {}
|
self.channels[channel] = self.IdDict()
|
||||||
self.channels[channel][id] = v
|
self.channels[channel][id] = v
|
||||||
|
|
||||||
def __delitem__(self, (channel, id)):
|
def __delitem__(self, (channel, id)):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user