fix: prevent system messages from being ignored in multi-channel search (#3875)

This commit is contained in:
James Upjohn 2022-07-24 10:18:25 +00:00 committed by GitHub
parent c58552781d
commit 218718e930
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,7 @@
## Unversioned
- Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694)
- Major: Added multi-channel searching to search dialog via keyboard shortcut. (Ctrl+Shift+F by default) (#3694, #3875)
- Minor: Added option to display tabs on the right and bottom. (#3847)
- Minor: Added `is:first-msg` search option. (#3700)
- Minor: Added quotation marks in the permitted/blocked Automod messages for clarity. (#3654)

View file

@ -188,7 +188,8 @@ LimitedQueueSnapshot<MessagePtr> SearchPopup::buildSnapshot()
auto uniqueIterator =
std::unique(combinedSnapshot.begin(), combinedSnapshot.end(),
[](MessagePtr &a, MessagePtr &b) {
return a->id == b->id;
// nullptr check prevents system messages from being dropped
return (a->id != nullptr) && a->id == b->id;
});
combinedSnapshot.erase(uniqueIterator, combinedSnapshot.end());