filter: Mark messages as read in -is:dm view.

We avoid doing the more complex composability here, since that's
potentially risky.

Fixes #25113.
This commit is contained in:
Tim Abbott
2025-07-18 16:09:27 -07:00
parent 3bd82927dc
commit 0f19fda610
2 changed files with 19 additions and 0 deletions

View File

@@ -1204,6 +1204,10 @@ export class Filter {
return true;
}
if (_.isEqual(term_types, ["not-is-dm"])) {
return true;
}
if (_.isEqual(term_types, ["is-resolved"])) {
return true;
}

View File

@@ -347,6 +347,21 @@ test("basics", () => {
assert.ok(filter.can_show_next_unread_dm_conversation_button());
assert.ok(!filter.has_exactly_channel_topic_operators());
terms = [{operator: "is", operand: "dm", negated: true}];
filter = new Filter(terms);
assert.ok(!filter.contains_only_private_messages());
assert.ok(filter.can_mark_messages_read());
assert.ok(filter.contains_no_partial_conversations());
assert.ok(!filter.has_operator("search"));
assert.ok(filter.can_apply_locally());
assert.ok(!filter.is_personal_filter());
assert.ok(!filter.is_conversation_view());
assert.ok(!filter.is_channel_view());
assert.ok(filter.may_contain_multiple_conversations());
assert.ok(!filter.can_show_next_unread_topic_conversation_button());
assert.ok(!filter.can_show_next_unread_dm_conversation_button());
assert.ok(!filter.has_exactly_channel_topic_operators());
// "is:private" was renamed to "is:dm"
terms = [{operator: "is", operand: "private"}];
filter = new Filter(terms);