mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 03:33:11 +01:00
Made sure the bot doesn't clobber an already-existing user in the user database when it changes nick.
This commit is contained in:
parent
e48569b64a
commit
da3be6b624
@ -543,7 +543,12 @@ class Irc(IrcCommandDispatcher):
|
||||
user = ircdb.users.getUser(0)
|
||||
user.unsetAuth()
|
||||
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)
|
||||
self.nick = newNick
|
||||
(nick, user, domain) = ircutils.splitHostmask(msg.prefix)
|
||||
|
Loading…
Reference in New Issue
Block a user