mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fixed bug #853654.
This commit is contained in:
parent
5a6b5329f1
commit
f26115bb9b
@ -370,14 +370,14 @@ class ChannelDB(plugins.ChannelDBHandler,
|
|||||||
if ('--user', '') in optlist:
|
if ('--user', '') in optlist:
|
||||||
table = 'user_stats'
|
table = 'user_stats'
|
||||||
criterion = 'user_id=%s'
|
criterion = 'user_id=%s'
|
||||||
name = ircdb.users.getUserId(name)
|
try:
|
||||||
if not ircdb.users.hasUser(name):
|
name = ircdb.users.getUserId(name)
|
||||||
|
except KeyError:
|
||||||
try:
|
try:
|
||||||
hostmask = irc.state.nickToHostmask(name)
|
hostmask = irc.state.nickToHostmask(name)
|
||||||
name = ircdb.users.getUser(hostmask).name
|
name = ircdb.users.getUserId(hostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(msg, conf.replyNoUser)
|
irc.error(msg, conf.replyNoUser)
|
||||||
return
|
|
||||||
else:
|
else:
|
||||||
table = 'nick_seen'
|
table = 'nick_seen'
|
||||||
criterion = 'normalized=%s'
|
criterion = 'normalized=%s'
|
||||||
|
@ -90,6 +90,9 @@ if sqlite is not None:
|
|||||||
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)
|
||||||
|
|
||||||
|
def testSeenNoUser(self):
|
||||||
|
self.assertNotRegexp('seen --user alsdkfjalsdfkj', 'KeyError')
|
||||||
|
|
||||||
def testWordStatsNoArgs(self):
|
def testWordStatsNoArgs(self):
|
||||||
self.assertResponse('wordstats', 'I am not currently keeping any '
|
self.assertResponse('wordstats', 'I am not currently keeping any '
|
||||||
'word stats.')
|
'word stats.')
|
||||||
|
Loading…
Reference in New Issue
Block a user