messages: Simplify API for use_first_unread_anchor.

Now that we have the type situation of having anchor support passing a
string, this is a much more natural way to implement
use_first_unread_anchor.

We still support the old interface to avoid breaking compatibility
with legacy versions of the mobile apps.
This commit is contained in:
Tim Abbott
2020-01-28 18:29:15 -08:00
parent 7bf3312114
commit b25fea24e7
7 changed files with 43 additions and 35 deletions

View File

@@ -162,9 +162,6 @@ exports.load_messages = function (opts) {
if (opts.msg_list === home_msg_list && page_params.narrow_stream !== undefined) {
data.narrow = JSON.stringify(page_params.narrow);
}
if (opts.use_first_unread_anchor) {
data.use_first_unread_anchor = true;
}
if (opts.num_before > 0) {
opts.msg_list.fetch_status.start_older_batch();
@@ -226,7 +223,6 @@ exports.load_messages_for_narrow = function (opts) {
num_before: consts.narrow_before,
num_after: consts.narrow_after,
msg_list: msg_list,
use_first_unread_anchor: opts.use_first_unread_anchor,
pre_scroll_cont: opts.pre_scroll_cont,
cont: function () {
message_scroll.hide_indicators();