mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-17 23:52:49 +01:00
Revert "clientbot: return existing PUIDs in spawnClient if nick exists"
This reverts commit 113fbf9eb8
.
Incomplete fix: would confuse virtual service bots and external users if they had the same nick.
This commit is contained in:
parent
113fbf9eb8
commit
4d4dbb7764
@ -84,22 +84,18 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
server = server or self.irc.sid
|
server = server or self.irc.sid
|
||||||
|
uid = self.uidgen.next_uid()
|
||||||
|
|
||||||
# First, check if the pseudouser we want already exists. If so, return their UID.
|
ts = ts or int(time.time())
|
||||||
uid = self.irc.nickToUid(nick)
|
|
||||||
if uid:
|
log.debug('(%s) spawnClient stub called, saving nick %s as PUID %s', self.irc.name, nick, uid)
|
||||||
log.debug('(%s) spawnClient stub called, returning existing PUID %s for %s',
|
u = self.irc.users[uid] = IrcUser(nick, ts, uid, ident=ident, host=host, realname=realname,
|
||||||
self.irc.name, uid, nick)
|
manipulatable=manipulatable, realhost=realhost, ip=ip)
|
||||||
return self.irc.users[uid]
|
self.irc.servers[server].users.add(uid)
|
||||||
else:
|
|
||||||
uid = self.uidgen.next_uid()
|
self.irc.applyModes(uid, modes)
|
||||||
ts = ts or int(time.time())
|
|
||||||
log.debug('(%s) spawnClient stub called, saving nick %s as PUID %s', self.irc.name, nick, uid)
|
return u
|
||||||
u = self.irc.users[uid] = IrcUser(nick, ts, uid, ident=ident, host=host, realname=realname,
|
|
||||||
manipulatable=manipulatable, realhost=realhost, ip=ip)
|
|
||||||
self.irc.servers[server].users.add(uid)
|
|
||||||
self.irc.applyModes(uid, modes)
|
|
||||||
return u
|
|
||||||
|
|
||||||
def spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0, internal=True):
|
def spawnServer(self, name, sid=None, uplink=None, desc=None, endburst_delay=0, internal=True):
|
||||||
"""
|
"""
|
||||||
@ -580,6 +576,7 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
oldnick = self.irc.serverdata['pylink_nick']
|
oldnick = self.irc.serverdata['pylink_nick']
|
||||||
self.irc.serverdata['pylink_nick'] = self.conf_nick = args[0]
|
self.irc.serverdata['pylink_nick'] = self.conf_nick = args[0]
|
||||||
log.debug('(%s) Pre-auth FNC: Forcing configured nick to %s from %s', self.irc.name, args[0], oldnick)
|
log.debug('(%s) Pre-auth FNC: Forcing configured nick to %s from %s', self.irc.name, args[0], oldnick)
|
||||||
|
return
|
||||||
|
|
||||||
oldnick = self.irc.users[source].nick
|
oldnick = self.irc.users[source].nick
|
||||||
self.irc.users[source].nick = args[0]
|
self.irc.users[source].nick = args[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user