Username was broken.

This commit is contained in:
Jeremy Fincher 2004-12-08 17:42:35 +00:00
parent 407952f5a0
commit f1cbd065f3

View File

@ -288,14 +288,23 @@ class User(callbacks.Privmsg):
setpassword = wrap(setpassword, [getopts({'hashed':''}), 'otherUser', setpassword = wrap(setpassword, [getopts({'hashed':''}), 'otherUser',
'something', 'something']) 'something', 'something'])
def username(self, irc, msg, args, user): def username(self, irc, msg, args, hostmask):
"""<hostmask|nick> """<hostmask|nick>
Returns the username of the user specified by <hostmask> or <nick> if Returns the username of the user specified by <hostmask> or <nick> if
the user is registered. the user is registered.
""" """
irc.reply(user.name) if ircutils.isNick(nickOrHostmask):
username = wrap(username, ['otherUser']) try:
hostmask = irc.state.nickToHostmask(hostmask)
except KeyError:
irc.error('I haven\'t seen %s.' % nick, Raise=True)
try:
user = ircdb.users.getUser(hostmask)
irc.reply(user.name)
except KeyError:
irc.error('I don\'t know who that is.')
username = wrap(username, [first('nick', 'hostmask')])
def hostmasks(self, irc, msg, args, name): def hostmasks(self, irc, msg, args, name):
"""[<name>] """[<name>]