search: Don't mark messages as read in search narrow.

Don't mark unread messages as read while searching.
This behavior will be extended to other narrows later.

Fixes: #12556.
This commit is contained in:
Mohit Gupta
2019-07-10 05:33:41 +05:30
committed by Tim Abbott
parent bd52ec9f95
commit 6ec40cf9a0
15 changed files with 66 additions and 10 deletions

View File

@@ -28,7 +28,9 @@ exports.down = function (with_centering) {
var current_msg_table = rows.get_table(current_msg_list.table_name);
message_viewport.scrollTop(current_msg_table.safeOuterHeight(true) -
message_viewport.height() * 0.1);
unread_ops.mark_current_list_as_read();
if (current_msg_list.can_mark_messages_read()) {
unread_ops.mark_current_list_as_read();
}
}
return;
@@ -54,7 +56,9 @@ exports.to_end = function () {
message_viewport.set_last_movement_direction(1);
current_msg_list.select_id(next_id, {then_scroll: true,
from_scroll: true});
unread_ops.mark_current_list_as_read();
if (current_msg_list.can_mark_messages_read()) {
unread_ops.mark_current_list_as_read();
}
};
function amount_to_paginate() {
@@ -114,7 +118,9 @@ exports.page_up = function () {
exports.page_down = function () {
if (message_viewport.at_bottom() && !current_msg_list.empty()) {
current_msg_list.select_id(current_msg_list.last().id, {then_scroll: false});
unread_ops.mark_current_list_as_read();
if (current_msg_list.can_mark_messages_read()) {
unread_ops.mark_current_list_as_read();
}
} else {
exports.page_down_the_right_amount();
}