|
|
@ -1878,7 +1878,7 @@ export class AppMessagesManager { |
|
|
|
this.newDialogsToHandle = {}; |
|
|
|
this.newDialogsToHandle = {}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public readHistory(peerID: number, maxID = 0) { |
|
|
|
public readHistory(peerID: number, maxID = 0, minID = 0) { |
|
|
|
// console.trace('start read')
|
|
|
|
// console.trace('start read')
|
|
|
|
var isChannel = AppPeersManager.isChannel(peerID); |
|
|
|
var isChannel = AppPeersManager.isChannel(peerID); |
|
|
|
var historyStorage = this.historiesStorage[peerID]; |
|
|
|
var historyStorage = this.historiesStorage[peerID]; |
|
|
@ -1971,16 +1971,18 @@ export class AppMessagesManager { |
|
|
|
message = this.messagesStorage[messageID]; |
|
|
|
message = this.messagesStorage[messageID]; |
|
|
|
if(message && !message.pFlags.out) { |
|
|
|
if(message && !message.pFlags.out) { |
|
|
|
message.pFlags.unread = false; |
|
|
|
message.pFlags.unread = false; |
|
|
|
|
|
|
|
|
|
|
|
if(this.messagesForHistory[messageID]) { |
|
|
|
if(this.messagesForHistory[messageID]) { |
|
|
|
this.messagesForHistory[messageID].pFlags.unread = false; |
|
|
|
this.messagesForHistory[messageID].pFlags.unread = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(this.messagesForDialogs[messageID]) { |
|
|
|
if(this.messagesForDialogs[messageID]) { |
|
|
|
this.messagesForDialogs[messageID].pFlags.unread = false; |
|
|
|
this.messagesForDialogs[messageID].pFlags.unread = false; |
|
|
|
} |
|
|
|
} |
|
|
|
//NotificationsManager.cancel('msg' + messageID); // warning
|
|
|
|
//NotificationsManager.cancel('msg' + messageID); // warning
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(messageID == maxID) break; |
|
|
|
if(messageID == minID) break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -2372,11 +2374,10 @@ export class AppMessagesManager { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if(foundDialog[0]) { |
|
|
|
if(foundDialog[0]) { |
|
|
|
if(!isOut && |
|
|
|
if(!isOut && newUnreadCount && foundDialog[0].top_message <= maxID) { |
|
|
|
newUnreadCount && |
|
|
|
|
|
|
|
foundDialog[0].top_message <= maxID) { |
|
|
|
|
|
|
|
newUnreadCount = foundDialog[0].unread_count = 0; |
|
|
|
newUnreadCount = foundDialog[0].unread_count = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let dialogKey = isOut ? 'read_outbox_max_id' : 'read_inbox_max_id'; |
|
|
|
let dialogKey = isOut ? 'read_outbox_max_id' : 'read_inbox_max_id'; |
|
|
|
foundDialog[0][dialogKey] = maxID; |
|
|
|
foundDialog[0][dialogKey] = maxID; |
|
|
|
} |
|
|
|
} |
|
|
|