This PR aims to fix #5470 where opening a user's info card would cause all of the user's messages to be re-logged for that channel. This only happens with user popups because all other "fake" channels (search, reply threads etc.) explicitly set the MessageFlags::DoNotLog flag when adding messages from a channel snapshot.
I've also cleaned up the logic around choosing what messages to log as it would prevent logging when passed overriding flags that DID NOT contain a DoNotLog flag. The altered logic now handles that, as well as checks the original message on the off chance someone's tagged that too. I've retested search and reply threads which all retain the original behaviour.
This PR aims to fix #5470 where opening a user's info card would cause all of the user's messages to be re-logged for that channel. This only happens with user popups because all other "fake" channels (search, reply threads etc.) explicitly set the
MessageFlags::DoNotLog
flag when adding messages from a channel snapshot.I've also cleaned up the logic around choosing what messages to log as it would prevent logging when passed overriding flags that DID NOT contain a
DoNotLog
flag. The altered logic now handles that, as well as checks the original message on the off chance someone's tagged that too. I've retested search and reply threads which all retain the original behaviour.Original behaviour (7bfb5ac0a):
https://github.com/Chatterino/chatterino2/assets/4962764/d243e691-234b-4d62-a44c-902cdc435282
Post-change behaviour (aca9e9b0, the hash in this clip was stale on my clipboard):
https://github.com/Chatterino/chatterino2/assets/4962764/5b123026-c10a-4674-9d3f-79590c7de2a6