From 8799e1ccc84567f7afd7f023981c13ce2dc71de6 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 23 Jul 2015 00:11:24 -0700 Subject: [PATCH] spawnClient: add ts as opt. argument; relay: spawn pseudoclients w/ TS of original user --- plugins/relay.py | 2 +- protocols/inspircd.py | 4 ++-- protocols/ts6.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index 6affcc9..fed7ebe 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -143,7 +143,7 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True): modes = getSupportedUmodes(irc, remoteirc, userobj.modes) u = remoteirc.proto.spawnClient(remoteirc, nick, ident=ident, host=host, realname=realname, - modes=modes).uid + modes=modes, ts=userobj.ts).uid remoteirc.users[u].remote = irc.name relayusers[(irc.name, user)][remoteirc.name] = u remoteirc.users[u].remote = irc.name diff --git a/protocols/inspircd.py b/protocols/inspircd.py index aa82579..1fe935b 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -25,7 +25,7 @@ def _send(irc, sid, msg): irc.send(':%s %s' % (sid, msg)) def spawnClient(irc, nick, ident='null', host='null', realhost=None, modes=set(), - server=None, ip='0.0.0.0', realname=None): + server=None, ip='0.0.0.0', realname=None, ts=None): server = server or irc.sid if not utils.isInternalServer(irc, server): raise ValueError('Server %r is not a PyLink internal PseudoServer!' % server) @@ -34,7 +34,7 @@ def spawnClient(irc, nick, ident='null', host='null', realhost=None, modes=set() if server not in irc.uidgen: irc.uidgen[server] = utils.TS6UIDGenerator(server) uid = irc.uidgen[server].next_uid() - ts = int(time.time()) + ts = ts or int(time.time()) realname = realname or irc.botdata['realname'] realhost = realhost or host raw_modes = utils.joinModes(modes) diff --git a/protocols/ts6.py b/protocols/ts6.py index 1529ba0..00cfbc6 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -24,7 +24,7 @@ def _send(irc, sid, msg): irc.send(':%s %s' % (sid, msg)) def spawnClient(irc, nick, ident='null', host='null', realhost=None, modes=set(), - server=None, ip='0.0.0.0', realname=None): + server=None, ip='0.0.0.0', realname=None, ts=None): server = server or irc.sid if not utils.isInternalServer(irc, server): raise ValueError('Server %r is not a PyLink internal PseudoServer!' % server) @@ -36,7 +36,7 @@ def spawnClient(irc, nick, ident='null', host='null', realhost=None, modes=set() # UID: # parameters: nickname, hopcount, nickTS, umodes, username, # visible hostname, IP address, UID, gecos - ts = int(time.time()) + ts = ts or int(time.time()) realname = realname or irc.botdata['realname'] realhost = realhost or host raw_modes = utils.joinModes(modes)