mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-26 04:32:51 +01:00
relay: don't spawn clones for service bots
This commit is contained in:
parent
2e1163fdb8
commit
28f992d3cb
@ -339,14 +339,10 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True):
|
|||||||
log.debug('(%s) getRemoteUser: waiting for %s.connected', irc.name, remoteirc.name)
|
log.debug('(%s) getRemoteUser: waiting for %s.connected', irc.name, remoteirc.name)
|
||||||
remoteirc.connected.wait()
|
remoteirc.connected.wait()
|
||||||
|
|
||||||
try:
|
# Don't spawn clones for registered service bots.
|
||||||
# We're relaying a message from the main PyLink client. These don't have
|
sbot = irc.isServiceBot(user)
|
||||||
# relay clones, so relay them through the other network's main client.
|
if sbot:
|
||||||
if user == irc.pseudoclient.uid:
|
return sbot.uids.get(remoteirc.name)
|
||||||
return remoteirc.pseudoclient.uid
|
|
||||||
|
|
||||||
except AttributeError: # Network hasn't been initialized yet?
|
|
||||||
return
|
|
||||||
|
|
||||||
log.debug('(%s) Grabbing spawnlocks[%s]', irc.name, irc.name)
|
log.debug('(%s) Grabbing spawnlocks[%s]', irc.name, irc.name)
|
||||||
with spawnlocks[irc.name]:
|
with spawnlocks[irc.name]:
|
||||||
|
Loading…
Reference in New Issue
Block a user