mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
Revert "narrow: Do not mark messages as read in mentioned narrow."
This reverts commit 5e97ec9ad9.
This change has been pretty confusing for users, and so we need to do
something more in order to make the UI acceptable to change this
default.
This commit is contained in:
@@ -170,7 +170,7 @@ test("basics", () => {
|
|||||||
operators = [{operator: "is", operand: "mentioned"}];
|
operators = [{operator: "is", operand: "mentioned"}];
|
||||||
filter = new Filter(operators);
|
filter = new Filter(operators);
|
||||||
assert.ok(!filter.contains_only_private_messages());
|
assert.ok(!filter.contains_only_private_messages());
|
||||||
assert.ok(!filter.can_mark_messages_read());
|
assert.ok(filter.can_mark_messages_read());
|
||||||
assert.ok(!filter.has_operator("search"));
|
assert.ok(!filter.has_operator("search"));
|
||||||
assert.ok(filter.can_apply_locally());
|
assert.ok(filter.can_apply_locally());
|
||||||
assert.ok(filter.is_personal_filter());
|
assert.ok(filter.is_personal_filter());
|
||||||
@@ -250,7 +250,11 @@ function assert_not_mark_read_with_is_operands(additional_operators_to_test) {
|
|||||||
|
|
||||||
is_operator = [{operator: "is", operand: "mentioned"}];
|
is_operator = [{operator: "is", operand: "mentioned"}];
|
||||||
filter = new Filter(additional_operators_to_test.concat(is_operator));
|
filter = new Filter(additional_operators_to_test.concat(is_operator));
|
||||||
|
if (additional_operators_to_test.length === 0) {
|
||||||
|
assert.ok(filter.can_mark_messages_read());
|
||||||
|
} else {
|
||||||
assert.ok(!filter.can_mark_messages_read());
|
assert.ok(!filter.can_mark_messages_read());
|
||||||
|
}
|
||||||
|
|
||||||
is_operator = [{operator: "is", operand: "mentioned", negated: true}];
|
is_operator = [{operator: "is", operand: "mentioned", negated: true}];
|
||||||
filter = new Filter(additional_operators_to_test.concat(is_operator));
|
filter = new Filter(additional_operators_to_test.concat(is_operator));
|
||||||
|
|||||||
@@ -453,6 +453,10 @@ export class Filter {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_.isEqual(term_types, ["is-mentioned"])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (_.isEqual(term_types, ["is-resolved"])) {
|
if (_.isEqual(term_types, ["is-resolved"])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -490,20 +494,15 @@ export class Filter {
|
|||||||
// can_mark_messages_read tests the following filters:
|
// can_mark_messages_read tests the following filters:
|
||||||
// stream, stream + topic,
|
// stream, stream + topic,
|
||||||
// is: private, pm-with:,
|
// is: private, pm-with:,
|
||||||
// is: resolved
|
// is: mentioned, is: resolved
|
||||||
if (this.can_mark_messages_read()) {
|
if (this.can_mark_messages_read()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// that leaves us with checking:
|
// that leaves us with checking:
|
||||||
// is: starred
|
// is: starred
|
||||||
// (which can_mark_messages_read_does not check as starred messages are always read)
|
// (which can_mark_messages_read_does not check as starred messages are always read)
|
||||||
// is: mentioned
|
|
||||||
// We don't mark messages as read when in mentioned narrow.
|
|
||||||
const term_types = this.sorted_term_types();
|
const term_types = this.sorted_term_types();
|
||||||
|
|
||||||
if (_.isEqual(term_types, ["is-mentioned"])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (_.isEqual(term_types, ["is-starred"])) {
|
if (_.isEqual(term_types, ["is-starred"])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user