3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00

relay: don't spawn clones for service bots

This commit is contained in:
James Lu 2016-05-14 16:17:20 -07:00
parent 2e1163fdb8
commit 28f992d3cb

View File

@ -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]: