narrow: Do not mark as read when narrowing by topic or recipient.

Previously, we've been assuming that when a user narrows to a topic
or recipient, that the target message would be marked as read in
resulting view. This is no longer a safe assumption because a user
can have their personal display settings to never mark messages as
read, even in conversation views.

Removes the call to `unread_ops.notify_server_message_read` in
both `narrow.by_topic` and `narrow.by_recipient` in the web app.
This commit is contained in:
Lauryn Menard 2023-05-03 15:27:38 +02:00 committed by Tim Abbott
parent 65c552e55a
commit a93598c22e
1 changed files with 0 additions and 10 deletions

View File

@ -925,11 +925,6 @@ export function by_topic(target_id, opts) {
return;
}
// We don't check msg_list.can_mark_messages_read here only because
// the target msg_list isn't initialized yet; in any case, the
// message is about to be marked read in the new view.
unread_ops.notify_server_message_read(original);
const search_terms = [
{operator: "stream", operand: original.stream},
{operator: "topic", operand: original.topic},
@ -944,11 +939,6 @@ export function by_recipient(target_id, opts) {
// don't use message_lists.current as it won't work for muted messages or for out-of-narrow links
const message = message_store.get(target_id);
// We don't check msg_list.can_mark_messages_read here only because
// the target msg_list isn't initialized yet; in any case, the
// message is about to be marked read in the new view.
unread_ops.notify_server_message_read(message);
switch (message.type) {
case "private":
by("dm", message.reply_to, opts);