Made sure the bot doesn't clobber an already-existing user in the user database when it changes nick.

This commit is contained in:
Jeremy Fincher 2003-11-12 23:56:26 +00:00
parent e48569b64a
commit da3be6b624

View File

@ -543,6 +543,11 @@ class Irc(IrcCommandDispatcher):
user = ircdb.users.getUser(0)
user.unsetAuth()
user.hostmasks = []
try:
ircdb.users.getUser(newNick)
s = 'User already registered with name %s' % newNick
debug.msg(s, 'high')
except KeyError:
user.name = newNick
ircdb.users.setUser(0, user)
self.nick = newNick