From 7d0c9eaddefbb0e6c7284636263660e3c354bcc7 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 10 Oct 2019 14:39:32 -0700 Subject: [PATCH] search: Fix conditions under which search warning appears. The warning is irrelevant for starred messages, since the user has UserMessage rows for any starred messages. --- static/js/narrow.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/static/js/narrow.js b/static/js/narrow.js index c4fcb907ba..dee3bee709 100644 --- a/static/js/narrow.js +++ b/static/js/narrow.js @@ -282,8 +282,12 @@ exports.activate = function (raw_operators, opts) { } // Toggle the notice that lets users know that not all messages were searched. + // One could imagine including `filter.is_search()` in these conditions, but + // there's a very legitimate use case for moderation of searching for all + // messages sent by a potential spammer user. if (!filter.contains_only_private_messages() && - !filter.includes_full_stream_history()) { + !filter.includes_full_stream_history() && + !filter.has_operand("is", "starred")) { $(".all-messages-search-caution").show(); } else { $(".all-messages-search-caution").hide();