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: if ('--user', '') in optlist:
table = 'user_stats' table = 'user_stats'
criterion = 'user_id=%s' criterion = 'user_id=%s'
try:
name = ircdb.users.getUserId(name) name = ircdb.users.getUserId(name)
if not ircdb.users.hasUser(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'

View File

@ -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.')