diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 0faa1e1..0be3372 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -697,12 +697,25 @@ class InspIRCdProtocol(TS6BaseProtocol): def handle_ijoin(self, source, command, args): """Handles InspIRCd 3 joins with membership ID.""" # insp3: + # EX: regular /join on an existing channel # <- :3INAAAAAA IJOIN #valhalla 6 + + # EX: /ojoin on an existing channel + # <- :3INAAAAAA IJOIN #valhalla 7 1559348434 Yo + + # From insp3 source: + # <- : IJOIN [ []] + # args idx: 0 1 2 3 + # For now we don't care about the membership ID channel = args[0] self.users[source].channels.add(channel) self._channels[channel].users.add(source) + # Apply prefix modes if they exist and the TS check passes + if len(args) >= 4 and int(args[2]) <= self._channels[channel].ts: + self.apply_modes(source, {('+%s' % mode, source) for mode in args[3]}) + return {'channel': channel, 'users': [source], 'modes': self._channels[channel].modes}