Add messages at bottom when message list is empty.

(imported from commit d15ff7ddb39e30ca08dd9d0eccf3dae75414a3ef)
This commit is contained in:
Tim Abbott
2013-07-03 16:33:27 -04:00
parent 43279b99ff
commit 641377e7e0

View File

@@ -591,10 +591,10 @@ function add_messages_helper(messages, msg_list, predicate, messages_are_new) {
}
// Put messages in correct order on either side of the message list
if (msg_list.empty() || (msg.id < msg_list.first().id)) {
top_messages.push(msg);
} else if (msg.id > msg_list.last().id) {
if (msg_list.empty() || msg.id > msg_list.last().id) {
bottom_messages.push(msg);
} else if (msg.id < msg_list.first().id) {
top_messages.push(msg);
} else {
interior_messages.push(msg);
}