mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed --user to actually work.
This commit is contained in:
parent
3d0bc9f8b2
commit
de7da5abc1
@ -289,18 +289,20 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
|
||||
cursor = db.cursor()
|
||||
(optlist, rest) = getopt.getopt(args, '', ['user'])
|
||||
name = privmsgs.getArgs(rest)
|
||||
if '--user' in optlist:
|
||||
#debug.printf(optlist)
|
||||
if ('--user', '') in optlist:
|
||||
table = 'user_stats'
|
||||
if not ircdb.users.hasUser(name):
|
||||
try:
|
||||
hostmask = irc.state.nickToHostmask(name)
|
||||
name = ircdb.users.getUser(hostmask).name
|
||||
table = 'user_stats'
|
||||
except KeyError:
|
||||
irc.error(msg, conf.replyNoUser)
|
||||
return
|
||||
else:
|
||||
table = 'nick_seen'
|
||||
sql = """SELECT last_seen, last_msg FROM %s WHERE name=%%s""" % table
|
||||
#debug.printf(sql)
|
||||
cursor.execute(sql, name)
|
||||
if cursor.rowcount == 0:
|
||||
irc.reply(msg, 'I have not seen %s.' % name)
|
||||
|
Loading…
Reference in New Issue
Block a user