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',
'something', 'something'])
def username(self, irc, msg, args, user):
def username(self, irc, msg, args, hostmask):
"""<hostmask|nick>
Returns the username of the user specified by <hostmask> or <nick> if
the user is registered.
"""
if ircutils.isNick(nickOrHostmask):
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)
username = wrap(username, ['otherUser'])
except KeyError:
irc.error('I don\'t know who that is.')
username = wrap(username, [first('nick', 'hostmask')])
def hostmasks(self, irc, msg, args, name):
"""[<name>]