Clear dialogs cache

This commit is contained in:
Igor Zhukov 2015-11-29 19:18:41 +03:00
parent 0b1ddc85f6
commit 5b98c89d08
2 changed files with 6 additions and 0 deletions

View File

@ -699,6 +699,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
dialog = $scope.dialogs[i];
if (dialogsUpdated[dialog.peerID]) {
$scope.dialogs.splice(i, 1);
AppMessagesManager.clearDialogCache($scope.dialogs.mid);
i--;
len--;
}

View File

@ -2019,6 +2019,10 @@ angular.module('myApp.services')
return message;
}
function clearDialogCache (msgID) {
delete messagesForDialogs[msgID];
}
function wrapForHistory (msgID) {
if (messagesForHistory[msgID] !== undefined) {
return messagesForHistory[msgID];
@ -2980,6 +2984,7 @@ angular.module('myApp.services')
convertMigratedPeer: convertMigratedPeer,
getMessagePeer: getMessagePeer,
getMessageThumb: getMessageThumb,
clearDialogCache: clearDialogCache,
wrapForDialog: wrapForDialog,
wrapForHistory: wrapForHistory,
wrapReplyMarkup: wrapReplyMarkup,