From c50e27a278ec5507935c6451195ec34b2b73d9f3 Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 10 Nov 2003 23:39:44 +0000 Subject: [PATCH] Fixed bug #838900. --- plugins/ChannelDB.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/plugins/ChannelDB.py b/plugins/ChannelDB.py index 56e93f8b1..52eece78f 100644 --- a/plugins/ChannelDB.py +++ b/plugins/ChannelDB.py @@ -62,6 +62,7 @@ frownre = re.compile('|'.join(map(re.escape, frowns))) class ChannelDB(callbacks.Privmsg, plugins.Configurable, plugins.ChannelDBHandler): + noIgnore = True configurables = plugins.ConfigurableDictionary( [('self-stats', plugins.ConfigurableTypes.bool, True, """Determines whether the bot will keep channel statistics on itself, @@ -115,7 +116,8 @@ class ChannelDB(callbacks.Privmsg, quits INTEGER )""") cursor.execute("""CREATE TABLE nick_seen ( - name TEXT UNIQUE ON CONFLICT REPLACE, + name TEXT, + normalized TEXT UNIQUE ON CONFLICT REPLACE, last_seen TIMESTAMP, last_msg TEXT )""") @@ -202,8 +204,8 @@ class ChannelDB(callbacks.Privmsg, msgs=msgs+1, actions=actions+%s""", smileys, frowns, chars, words, int(isAction)) - cursor.execute("""INSERT INTO nick_seen VALUES (%s, %s, %s)""", - msg.nick, int(time.time()), s) + cursor.execute("""INSERT INTO nick_seen VALUES (%s, %s, %s, %s)""", + msg.nick,ircutils.toLower(msg.nick),int(time.time()),s) try: if self.outFiltering: id = 0 @@ -359,7 +361,8 @@ class ChannelDB(callbacks.Privmsg, return else: table = 'nick_seen' - criterion = 'nickeq(name,%s)' + criterion = 'normalized=%s' + name = ircutils.toLower(name) sql = "SELECT last_seen,last_msg FROM %s WHERE %s" % (table,criterion) #debug.printf(sql) cursor.execute(sql, name)