From c7b7e6e3ada5afe616dfeb3460eb1c3b0c169664 Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Thu, 16 Jun 2011 21:26:13 -0500 Subject: [PATCH] Seen: don't track seen data for stuff without a location like the last commit, this happens on [subcommands] --- modules/Seen.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/Seen.py b/modules/Seen.py index a0f07f2..81181ec 100644 --- a/modules/Seen.py +++ b/modules/Seen.py @@ -81,11 +81,13 @@ class Seen(Module): # whatever it is, store it try: - db = self.get_db() - cur = db.cursor() - statement = 'REPLACE INTO seen_nicks (nick, location, host, what) VALUES (?, ?, ?, ?)' - cur.execute(statement, (nick, where, userhost, what.decode('utf-8', 'replace'))) - db.commit() + # if there's no where, this is probably a sub-command. don't learn it + if where: + db = self.get_db() + cur = db.cursor() + statement = 'REPLACE INTO seen_nicks (nick, location, host, what) VALUES (?, ?, ?, ?)' + cur.execute(statement, (nick, where, userhost, what.decode('utf-8', 'replace'))) + db.commit() except sqlite3.Error as e: db.rollback() print("sqlite error: " + str(e))