From 80548ca8f9e4e191e1ac46f84e6a7a563a593666 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Fri, 20 Sep 2013 13:12:07 -0700 Subject: [PATCH] plugins/seen: don't use LIKE (SQL wildcards confuse people), compare lowercase nicks instead --- plugins/seen.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/plugins/seen.py b/plugins/seen.py index bab5c2d..7d0d5b0 100644 --- a/plugins/seen.py +++ b/plugins/seen.py @@ -26,17 +26,19 @@ def seeninput(paraml, input=None, db=None, bot=None): def seen(inp, nick='', chan='', db=None, input=None): ".seen -- Tell when a nickname was last in active in irc" - if input.conn.nick.lower() == inp.lower(): + inp = inp.lower() + + if input.conn.nick.lower() == inp: # user is looking for us, being a smartass return "You need to get your eyes checked." - if inp.lower() == nick.lower(): + if inp == nick.lower(): return "Have you looked in a mirror lately?" db_init(db) - last_seen = db.execute("select name, time, quote from seen where name" - " like ? and chan = ?", (inp, chan)).fetchone() + last_seen = db.execute("select name, time, quote from seen where" + " name = ? and chan = ?", (inp, chan)).fetchone() if last_seen: reltime = timesince.timesince(last_seen[1])