3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 11:42:51 +01:00

clientbot: only call spawnClient for new message sources after irc.pseudoclient is set

This commit is contained in:
James Lu 2016-09-01 13:08:20 -07:00
parent 4d4dbb7764
commit d1e2dfcf61
2 changed files with 2 additions and 1 deletions

View File

@ -51,6 +51,7 @@ def spawn_service(irc, source, command, args):
# Special case: if this is the main PyLink client being spawned,
# assign this as irc.pseudoclient.
if name == 'pylink':
log.debug('(%s) irc.pseudoclient set to UID %s', irc.name, u)
irc.pseudoclient = userobj
# TODO: channels should be tracked in a central database, not hardcoded

View File

@ -308,7 +308,7 @@ class ClientbotWrapperProtocol(Protocol):
nick, ident, host = utils.splitHostmask(sender)
idsource = self.irc.nickToUid(nick)
if not idsource:
if (not idsource) and self.irc.pseudoclient:
# We don't know the sender, so it most be new.
idsource = self.spawnClient(nick, ident, host, server=self.irc.uplink).uid