mirror of
https://github.com/zulip/zulip.git
synced 2025-11-08 16:01:58 +00:00
message_list_view: Remove dead next_is_same_sender code.
The `next_is_same_sender` has no effect on the CSS of the message
displayed and the JS changes seem to have no effect too.
See cc8021a742 for more details.
This commit is contained in:
@@ -426,9 +426,6 @@ export class MessageListView {
|
||||
let prev;
|
||||
|
||||
const add_message_container_to_group = (message_container) => {
|
||||
if (same_sender(prev, message_container)) {
|
||||
prev.next_is_same_sender = true;
|
||||
}
|
||||
current_group.message_containers.push(message_container);
|
||||
};
|
||||
|
||||
@@ -530,9 +527,6 @@ export class MessageListView {
|
||||
) {
|
||||
first_msg_container.include_sender = false;
|
||||
}
|
||||
if (same_sender(last_msg_container, first_msg_container)) {
|
||||
last_msg_container.next_is_same_sender = true;
|
||||
}
|
||||
first_group.message_containers = first_group.message_containers.concat(
|
||||
second_group.message_containers,
|
||||
);
|
||||
@@ -563,7 +557,6 @@ export class MessageListView {
|
||||
prepend_groups: [],
|
||||
rerender_groups: [],
|
||||
append_messages: [],
|
||||
rerender_messages_next_same_sender: [],
|
||||
};
|
||||
let first_group;
|
||||
let second_group;
|
||||
@@ -623,7 +616,6 @@ export class MessageListView {
|
||||
} else {
|
||||
if (was_joined) {
|
||||
// rerender the last message
|
||||
message_actions.rerender_messages_next_same_sender.push(prev_msg_container);
|
||||
message_actions.append_messages = new_message_groups[0].message_containers;
|
||||
new_message_groups = new_message_groups.slice(1);
|
||||
} else if (first_group !== undefined && second_group !== undefined) {
|
||||
@@ -837,25 +829,6 @@ export class MessageListView {
|
||||
}
|
||||
}
|
||||
|
||||
// Update the rendering for message rows which used to be last
|
||||
// and now know whether the following message has the same
|
||||
// sender.
|
||||
//
|
||||
// It is likely the case that we can just remove the block
|
||||
// entirely, since it appears the next_is_same_sender CSS
|
||||
// class doesn't do anything.
|
||||
if (message_actions.rerender_messages_next_same_sender.length > 0) {
|
||||
const targets = message_actions.rerender_messages_next_same_sender;
|
||||
|
||||
for (const message_container of targets) {
|
||||
const $row = this.get_row(message_container.msg.id);
|
||||
$row.find("div.messagebox").toggleClass(
|
||||
"next_is_same_sender",
|
||||
message_container.next_is_same_sender,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Insert new messages in to the last message group
|
||||
if (message_actions.append_messages.length > 0) {
|
||||
$last_message_row = $table.find(".message_row").last().expectOne();
|
||||
|
||||
Reference in New Issue
Block a user