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,7 +543,12 @@ class Irc(IrcCommandDispatcher):
user = ircdb.users.getUser(0) user = ircdb.users.getUser(0)
user.unsetAuth() user.unsetAuth()
user.hostmasks = [] user.hostmasks = []
user.name = newNick 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) ircdb.users.setUser(0, user)
self.nick = newNick self.nick = newNick
(nick, user, domain) = ircutils.splitHostmask(msg.prefix) (nick, user, domain) = ircutils.splitHostmask(msg.prefix)