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.
This commit is contained in:
Tim Abbott 2019-10-10 14:39:32 -07:00
parent b69213808a
commit 7d0c9eadde
1 changed files with 5 additions and 1 deletions

View File

@ -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();