mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-24 03:33:10 +01:00
clientbot: only call spawnClient for new message sources after irc.pseudoclient is set
This commit is contained in:
parent
4d4dbb7764
commit
d1e2dfcf61
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user