mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-26 03:54:08 +01:00
Make sure seen doesn't warp the case of the nick given.
This commit is contained in:
parent
f453d10e9a
commit
57b038ea63
@ -390,6 +390,7 @@ class ChannelDB(plugins.ChannelDBHandler,
|
|||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
(optlist, rest) = getopt.getopt(args, '', ['user'])
|
(optlist, rest) = getopt.getopt(args, '', ['user'])
|
||||||
name = privmsgs.getArgs(rest)
|
name = privmsgs.getArgs(rest)
|
||||||
|
originalName = name
|
||||||
if ('--user', '') in optlist:
|
if ('--user', '') in optlist:
|
||||||
table = 'user_stats'
|
table = 'user_stats'
|
||||||
criterion = 'user_id=%s'
|
criterion = 'user_id=%s'
|
||||||
@ -415,7 +416,7 @@ class ChannelDB(plugins.ChannelDBHandler,
|
|||||||
if isinstance(name, int):
|
if isinstance(name, int):
|
||||||
name = ircdb.users.getUser(int(name)).name
|
name = ircdb.users.getUser(int(name)).name
|
||||||
s = '%s was last seen here %s ago saying: %s' % \
|
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)
|
irc.reply(s)
|
||||||
|
|
||||||
def stats(self, irc, msg, args):
|
def stats(self, irc, msg, args):
|
||||||
|
@ -86,7 +86,8 @@ if sqlite is not None:
|
|||||||
def testSeen(self):
|
def testSeen(self):
|
||||||
self.assertNotError('list')
|
self.assertNotError('list')
|
||||||
self.assertNotError('seen %s' % self.nick)
|
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,
|
self.assertRegexp('seen --user %s' % self.nick,
|
||||||
'^%s was last seen' % self.nick)
|
'^%s was last seen' % self.nick)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user