mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Refactored a touch.
This commit is contained in:
parent
973cc66793
commit
8f1329b20e
@ -352,7 +352,7 @@ class ChannelDB(callbacks.Privmsg,
|
|||||||
if not ircdb.users.hasUser(name):
|
if not ircdb.users.hasUser(name):
|
||||||
try:
|
try:
|
||||||
hostmask = irc.state.nickToHostmask(name)
|
hostmask = irc.state.nickToHostmask(name)
|
||||||
name = ircdb.users.getUserId(hostmask)
|
name = ircdb.users.getUser(hostmask).name
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(msg, conf.replyNoUser)
|
irc.error(msg, conf.replyNoUser)
|
||||||
return
|
return
|
||||||
@ -367,8 +367,6 @@ class ChannelDB(callbacks.Privmsg,
|
|||||||
else:
|
else:
|
||||||
(seen, m) = cursor.fetchone()
|
(seen, m) = cursor.fetchone()
|
||||||
seen = int(seen)
|
seen = int(seen)
|
||||||
if isinstance(name, int):
|
|
||||||
name = ircdb.users.getUser(int(name)).name
|
|
||||||
s = '%s was last seen here %s ago saying %r' % \
|
s = '%s was last seen here %s ago saying %r' % \
|
||||||
(name, utils.timeElapsed(time.time() - seen), m)
|
(name, utils.timeElapsed(time.time() - seen), m)
|
||||||
irc.reply(msg, s)
|
irc.reply(msg, s)
|
||||||
|
Loading…
Reference in New Issue
Block a user