From c2fc9080cca2d0b6bd1119fbe403c0296ec96b84 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 23 Aug 2017 19:11:15 -0700 Subject: [PATCH] clientbot: don't send JOIN hooks for the bot itself when receiving JOIN Closes #519. --- protocols/clientbot.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 143912d..3d4c213 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -828,18 +828,17 @@ class ClientbotWrapperProtocol(IRCCommonProtocol): """ # <- :GL|!~GL@127.0.0.1 JOIN #whatever channel = args[0] + self.channels[channel].users.add(source) + self.users[source].channels.add(channel) # Only fetch modes, TS, and user hosts once we're actually in the channel. # The IRCd will send us a JOIN with our nick!user@host if our JOIN succeeded. if self.pseudoclient and source == self.pseudoclient.uid: self.send('MODE %s' % channel) self._send_who(channel) - - self.channels[channel].users.add(source) - self.users[source].channels.add(channel) - - self.call_hooks([source, 'CLIENTBOT_JOIN', {'channel': channel}]) - return {'channel': channel, 'users': [source], 'modes': self.channels[channel].modes} + else: + self.call_hooks([source, 'CLIENTBOT_JOIN', {'channel': channel}]) + return {'channel': channel, 'users': [source], 'modes': self.channels[channel].modes} def handle_kick(self, source, command, args): """