From 218718e930c747e85135a77b619a57fbf6966059 Mon Sep 17 00:00:00 2001 From: James Upjohn Date: Sun, 24 Jul 2022 10:18:25 +0000 Subject: [PATCH] fix: prevent system messages from being ignored in multi-channel search (#3875) --- CHANGELOG.md | 2 +- src/widgets/helper/SearchPopup.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 94622c701..d0ca8eb59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/widgets/helper/SearchPopup.cpp b/src/widgets/helper/SearchPopup.cpp index b809b0f29..9b255d27d 100644 --- a/src/widgets/helper/SearchPopup.cpp +++ b/src/widgets/helper/SearchPopup.cpp @@ -188,7 +188,8 @@ LimitedQueueSnapshot 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());