3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-17 14:01:03 +01:00

clientbot: forward SJOIN on the main client as JOIN (#299)

This commit is contained in:
James Lu 2016-08-11 11:24:23 -07:00
parent 3a0a2c7f1c
commit 226089cc3c

View File

@ -225,6 +225,11 @@ class ClientbotWrapperProtocol(Protocol):
# given. modes and TS are currently ignored.
puids = {u[-1] for u in users}
for user in puids:
if self.irc.pseudoclient and self.irc.pseudoclient.uid == user:
# If the SJOIN affects our main client, forward it as a regular JOIN.
self.join(user, channel)
else:
# Otherwise, track the state for our virtual clients.
self.irc.users[user].channels.add(channel)
self.irc.channels[channel].users |= puids