Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_list: Rename variable for caller clarity.

Aman Agrawalc5feccaa3487
diff --git a/web/src/message_fetch.ts b/web/src/message_fetch.ts
index 5a92a5e85b3..06d33589e58 100644
--- a/web/src/message_fetch.ts
+++ b/web/src/message_fetch.ts
@@ -153,7 +153,7 @@ function process_result(data: MessageFetchResponse, opts: MessageFetchOptions):
// messages not tracked in unread.ts during this fetching process.
message_util.do_unread_count_updates(messages, true);
- const ignore_found_newest = true;
+ const is_contiguous_history = true;
if (messages.length > 0) {
if (opts.msg_list) {
if (opts.validate_filter_topic_post_fetch) {
@@ -161,9 +161,9 @@ function process_result(data: MessageFetchResponse, opts: MessageFetchOptions):
}
// Since this adds messages to the MessageList and renders MessageListView,
// we don't need to call it if msg_list was not defined by the caller.
- opts.msg_list.add_messages(messages, {}, ignore_found_newest);
+ opts.msg_list.add_messages(messages, {}, is_contiguous_history);
} else {
- opts.msg_list_data.add_messages(messages, ignore_found_newest);
+ opts.msg_list_data.add_messages(messages, is_contiguous_history);
}
}
diff --git a/web/src/message_list.ts b/web/src/message_list.ts
index dcd7e3e42b0..d0d10aea655 100644
--- a/web/src/message_list.ts
+++ b/web/src/message_list.ts
@@ -193,11 +193,11 @@ export class MessageList {
add_messages(
messages: Message[],
append_to_view_opts: {messages_are_new?: boolean} = {},
- ignore_found_newest = false,
+ is_contiguous_history = false,
): RenderInfo | undefined {
// This adds all messages to our data, but only returns
// the currently viewable ones.
- const info = this.data.add_messages(messages, ignore_found_newest);
+ const info = this.data.add_messages(messages, is_contiguous_history);
const top_messages = info.top_messages;
const bottom_messages = info.bottom_messages;
diff --git a/web/src/message_list_data.ts b/web/src/message_list_data.ts
index 789745a6a62..de4f8fcb05d 100644
--- a/web/src/message_list_data.ts
+++ b/web/src/message_list_data.ts
@@ -297,7 +297,7 @@ export class MessageListData {
add_messages(
messages: Message[],
- ignore_found_newest = false,
+ is_contiguous_history = false,
): {
top_messages: Message[];
bottom_messages: Message[];
@@ -335,7 +335,7 @@ export class MessageListData {
top_messages = this.prepend(top_messages);
}
- if (!ignore_found_newest && !this.fetch_status.has_found_newest()) {
+ if (!is_contiguous_history && !this.fetch_status.has_found_newest()) {
// Don't add messages at the bottom if we haven't found
// the latest message to avoid non-contiguous message history.
this.fetch_status.update_expected_max_message_id(bottom_messages);
diff --git a/web/src/message_view.ts b/web/src/message_view.ts
index f749d6bc8d7..64bb3062205 100644
--- a/web/src/message_view.ts
+++ b/web/src/message_view.ts
@@ -912,8 +912,8 @@ function load_local_messages(msg_data: MessageListData, superset_data: MessageLi
// one message the user will expect to see in the new narrow.
const in_msgs = superset_data.all_messages();
- const ignore_found_newest = true;
- msg_data.add_messages(in_msgs, ignore_found_newest);
+ const is_contiguous_history = true;
+ msg_data.add_messages(in_msgs, is_contiguous_history);
return !msg_data.visibly_empty();
}