42wim / matterircd

Connect to your mattermost or slack using your IRC-client of choice.
MIT License
294 stars 60 forks source link

Fix join and part/leave on replay #567

Open hloeung opened 11 months ago

hloeung commented 11 months ago

Without this, on matterircd reconnect & relay, users in channels can be out of sync. This causes issues with trying to auto-complete IRC nicks for example.

kot0dama commented 4 months ago

Seems this will cause BIP IRC Proxy to crash, as in some cases, bip will try to add an already existing user to a channel user list it already had when receiving a JOIN, or remove a nonexistent user from a list when receiving a PART.

I believe a server should only send PART / JOIN when it has sent a channel user list without the related change (like with NAMES or WHO commands). I'm not sure that's required per the RFC but I would expect the RFC to be strict about sending PART and JOIN messages when the result of such action is already visible in NAMES or WHO.

I think this happened when I (or someone else) was forcefully added to a channel, bip received the full user list, and then a JOIN command.