3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +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,7 +225,12 @@ class ClientbotWrapperProtocol(Protocol):
# given. modes and TS are currently ignored.
puids = {u[-1] for u in users}
for user in puids:
self.irc.users[user].channels.add(channel)
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
nicks = {self.irc.getFriendlyName(u) for u in puids}