mirror of https://github.com/zulip/zulip.git
Me messages should always display the sender
(imported from commit af42ed8dcb9f4bc44e66d4973b9e613302647e12)
This commit is contained in:
parent
441688b41e
commit
c38c9cf894
|
@ -210,7 +210,7 @@ MessageListView.prototype = {
|
||||||
|
|
||||||
// Join two groups into one.
|
// Join two groups into one.
|
||||||
if (this.collapse_messages && util.same_recipient(last_msg, first_msg) && same_day(last_msg, first_msg) && (last_msg.historical === first_msg.historical)) {
|
if (this.collapse_messages && util.same_recipient(last_msg, first_msg) && same_day(last_msg, first_msg) && (last_msg.historical === first_msg.historical)) {
|
||||||
if (!last_msg.status_message && util.same_sender(last_msg, first_msg)) {
|
if (!last_msg.status_message && !first_msg.is_me_message && util.same_sender(last_msg, first_msg)) {
|
||||||
first_msg.include_sender = false;
|
first_msg.include_sender = false;
|
||||||
}
|
}
|
||||||
if (util.same_sender(last_msg, first_msg)) {
|
if (util.same_sender(last_msg, first_msg)) {
|
||||||
|
|
|
@ -28,7 +28,8 @@ set_global('unread', {message_unread: function () {}});
|
||||||
stream: 'Test Stream 1',
|
stream: 'Test Stream 1',
|
||||||
subject: 'Test Subject 1',
|
subject: 'Test Subject 1',
|
||||||
sender_email: 'test@example.com',
|
sender_email: 'test@example.com',
|
||||||
timestamp: _.uniqueId()
|
timestamp: _.uniqueId(),
|
||||||
|
include_sender: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -190,6 +191,34 @@ set_global('unread', {message_unread: function () {}});
|
||||||
assert_message_list_equal(result.rerender_messages, []);
|
assert_message_list_equal(result.rerender_messages, []);
|
||||||
}());
|
}());
|
||||||
|
|
||||||
|
(function test_append_message_same_subject_me_message() {
|
||||||
|
|
||||||
|
var message1 = build_message();
|
||||||
|
var message_group1 = build_message_group([
|
||||||
|
message1
|
||||||
|
]);
|
||||||
|
|
||||||
|
var message2 = build_message({is_me_message: true});
|
||||||
|
var message_group2 = build_message_group([
|
||||||
|
message2
|
||||||
|
]);
|
||||||
|
|
||||||
|
var list = build_list([message_group1]);
|
||||||
|
var result = list.merge_message_groups([message_group2], 'bottom');
|
||||||
|
|
||||||
|
assert(message2.include_sender);
|
||||||
|
assert_message_groups_list_equal(
|
||||||
|
list._message_groups,
|
||||||
|
[build_message_group([message1, message2])]
|
||||||
|
);
|
||||||
|
assert_message_groups_list_equal(result.append_groups, []);
|
||||||
|
assert_message_groups_list_equal(result.prepend_groups, []);
|
||||||
|
assert_message_groups_list_equal(result.rerender_groups, []);
|
||||||
|
assert_message_list_equal(result.append_messages, [message2]);
|
||||||
|
assert_message_list_equal(result.rerender_messages, [message1]);
|
||||||
|
}());
|
||||||
|
|
||||||
|
|
||||||
(function test_prepend_message_same_subject() {
|
(function test_prepend_message_same_subject() {
|
||||||
|
|
||||||
var message1 = build_message();
|
var message1 = build_message();
|
||||||
|
|
Loading…
Reference in New Issue