Make sure seen doesn't warp the case of the nick given.

This commit is contained in:
Jeremy Fincher 2004-01-08 23:31:01 +00:00
parent f453d10e9a
commit 57b038ea63
2 changed files with 4 additions and 2 deletions

View File

@ -390,6 +390,7 @@ class ChannelDB(plugins.ChannelDBHandler,
cursor = db.cursor()
(optlist, rest) = getopt.getopt(args, '', ['user'])
name = privmsgs.getArgs(rest)
originalName = name
if ('--user', '') in optlist:
table = 'user_stats'
criterion = 'user_id=%s'
@ -415,7 +416,7 @@ class ChannelDB(plugins.ChannelDBHandler,
if isinstance(name, int):
name = ircdb.users.getUser(int(name)).name
s = '%s was last seen here %s ago saying: %s' % \
(name, utils.timeElapsed(time.time() - seen), m)
(originalName, utils.timeElapsed(time.time() - seen), m)
irc.reply(s)
def stats(self, irc, msg, args):

View File

@ -86,7 +86,8 @@ if sqlite is not None:
def testSeen(self):
self.assertNotError('list')
self.assertNotError('seen %s' % self.nick)
self.assertNotError('seen %s' % self.nick.upper())
m = self.assertNotError('seen %s' % self.nick.upper())
self.failUnless(self.nick.upper() in m.args[1])
self.assertRegexp('seen --user %s' % self.nick,
'^%s was last seen' % self.nick)