This commit is contained in:
Jeremy Fincher 2003-12-05 12:08:24 +00:00
parent 5a6b5329f1
commit f26115bb9b
2 changed files with 7 additions and 4 deletions

View File

@ -370,14 +370,14 @@ class ChannelDB(plugins.ChannelDBHandler,
if ('--user', '') in optlist:
table = 'user_stats'
criterion = 'user_id=%s'
name = ircdb.users.getUserId(name)
if not ircdb.users.hasUser(name):
try:
name = ircdb.users.getUserId(name)
except KeyError:
try:
hostmask = irc.state.nickToHostmask(name)
name = ircdb.users.getUser(hostmask).name
name = ircdb.users.getUserId(hostmask)
except KeyError:
irc.error(msg, conf.replyNoUser)
return
else:
table = 'nick_seen'
criterion = 'normalized=%s'

View File

@ -90,6 +90,9 @@ if sqlite is not None:
self.assertRegexp('seen --user %s' % self.nick,
'^%s was last seen' % self.nick)
def testSeenNoUser(self):
self.assertNotRegexp('seen --user alsdkfjalsdfkj', 'KeyError')
def testWordStatsNoArgs(self):
self.assertResponse('wordstats', 'I am not currently keeping any '
'word stats.')