From a93598c22eb2af5e8c07ea9ed2d1eb6c890ffda5 Mon Sep 17 00:00:00 2001 From: Lauryn Menard Date: Wed, 3 May 2023 15:27:38 +0200 Subject: [PATCH] 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. --- web/src/narrow.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/web/src/narrow.js b/web/src/narrow.js index 19465e3632..dcc3e3e0fa 100644 --- a/web/src/narrow.js +++ b/web/src/narrow.js @@ -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);