From 242a6d3429bf4d159ea90682a1d4b2b704f73f60 Mon Sep 17 00:00:00 2001 From: Yizhe Shen Date: Tue, 17 Feb 2015 22:43:37 -0500 Subject: [PATCH] Fix for first part of issue #321. - Ensures that Game.lastWinner will always store the original from of a user's nick/username - Fixes the username check in TriviaTime.next() to ignore case --- plugin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugin.py b/plugin.py index d315a10..fe68f0a 100644 --- a/plugin.py +++ b/plugin.py @@ -2360,7 +2360,7 @@ class Storage: def updateGameLongestStreak(self, channel, lastWinner, streak): c = self.conn.cursor() channelCanonical = ircutils.toLower(channel) - lastWinnerCanonical = ircutils.toLower(lastWinner) + lastWinnerCanonical = ircutils.toLower(lastWinner) test = c.execute('''UPDATE triviagames SET longest_streak=?, longest_streak_holder=?, @@ -2377,7 +2377,6 @@ class Storage: return self.insertGame(channel, 0, None) c = self.conn.cursor() channelCanonical = ircutils.toLower(channel) - lastWinner = ircutils.toLower(lastWinner) test = c.execute('''UPDATE triviagames SET last_winner=?, streak=? @@ -3598,7 +3597,7 @@ class TriviaTime(callbacks.Plugin): self.reply(irc, msg, 'Trivia is not currently running.') elif game.questionOver == False: self.reply(irc, msg, 'You must wait until the current question is over.') - elif game.lastWinner != ircutils.toLower(username): + elif ircutils.toLower(game.lastWinner) != ircutils.toLower(username): self.reply(irc, msg, 'You are not currently the streak holder.') elif game.streak < minStreak: self.reply(irc, msg, 'You do not have a large enough streak yet (%i of %i).' % (game.streak, minStreak))