3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +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)
remoteirc.connected.wait()
try:
# We're relaying a message from the main PyLink client. These don't have
# relay clones, so relay them through the other network's main client.
if user == irc.pseudoclient.uid:
return remoteirc.pseudoclient.uid
except AttributeError: # Network hasn't been initialized yet?
return
# Don't spawn clones for registered service bots.
sbot = irc.isServiceBot(user)
if sbot:
return sbot.uids.get(remoteirc.name)
log.debug('(%s) Grabbing spawnlocks[%s]', irc.name, irc.name)
with spawnlocks[irc.name]: