mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +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 = 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)
|
||||||
|
Loading…
Reference in New Issue
Block a user