Fixed chat create

This commit is contained in:
Igor Zhukov 2015-04-15 18:10:27 +03:00
parent 3f13351b1c
commit c12bc72d8d

View File

@ -1598,9 +1598,13 @@ angular.module('myApp.controllers', ['myApp.i18n'])
var messageID, historyMessage, i;
var hasOut = false;
var unreadAfterNew = false;
var lastIsRead = !(history.messages[history.messages.length - 1] || {}).unread;
var historyMessage = history.messages[history.messages.length - 1];
var lastIsRead = !historyMessage || !historyMessage.unread;
for (i = 0; i < len; i++) {
messageID = msgs[i];
if (historyMessage.id == messageID) {
continue;
}
historyMessage = AppMessagesManager.wrapForHistory(messageID);
history.messages.push(historyMessage);
if (!unreadAfterNew && isIDLE) {