|
|
@ -2198,14 +2198,22 @@ export class AppMessagesManager { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
delete this.notificationsToHandle[peerId]; |
|
|
|
delete this.notificationsToHandle[peerId]; |
|
|
|
delete this.typings[peerId]; |
|
|
|
delete this.typings[peerId]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const c = this.reloadConversationsPeers.get(peerId); |
|
|
|
|
|
|
|
if(c) { |
|
|
|
this.reloadConversationsPeers.delete(peerId); |
|
|
|
this.reloadConversationsPeers.delete(peerId); |
|
|
|
|
|
|
|
c.promise.resolve(undefined); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.dialogsStorage.dropDialog(peerId); |
|
|
|
this.dialogsStorage.dropDialogOnDeletion(peerId); |
|
|
|
rootScope.dispatchEvent('dialog_drop', {peerId}); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public onPeerDeleted(peerId: number) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public hidePinnedMessages(peerId: PeerId) { |
|
|
|
public hidePinnedMessages(peerId: PeerId) { |
|
|
|
return Promise.all([ |
|
|
|
return Promise.all([ |
|
|
|
appStateManager.getState(), |
|
|
|
appStateManager.getState(), |
|
|
@ -3255,10 +3263,7 @@ export class AppMessagesManager { |
|
|
|
//setTimeout(() => {
|
|
|
|
//setTimeout(() => {
|
|
|
|
rootScope.dispatchEvent('dialog_migrate', {migrateFrom, migrateTo}); |
|
|
|
rootScope.dispatchEvent('dialog_migrate', {migrateFrom, migrateTo}); |
|
|
|
|
|
|
|
|
|
|
|
const dropped = this.dialogsStorage.dropDialog(migrateFrom); |
|
|
|
this.dialogsStorage.dropDialogWithEvent(migrateFrom); |
|
|
|
if(dropped.length) { |
|
|
|
|
|
|
|
rootScope.dispatchEvent('dialog_drop', {peerId: migrateFrom, dialog: dropped[0]}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//}, 100);
|
|
|
|
//}, 100);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -4697,10 +4702,7 @@ export class AppMessagesManager { |
|
|
|
if(needDialog) { |
|
|
|
if(needDialog) { |
|
|
|
this.reloadConversation(peerId); |
|
|
|
this.reloadConversation(peerId); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if(dialog) { |
|
|
|
this.dialogsStorage.dropDialogOnDeletion(peerId); |
|
|
|
this.dialogsStorage.dropDialog(peerId); |
|
|
|
|
|
|
|
rootScope.dispatchEvent('dialog_drop', {peerId, dialog}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -5350,7 +5352,8 @@ export class AppMessagesManager { |
|
|
|
|
|
|
|
|
|
|
|
// * add bound manually.
|
|
|
|
// * add bound manually.
|
|
|
|
// * offset_id will be inclusive only if there is 'add_offset' <= -1 (-1 - will only include the 'offset_id')
|
|
|
|
// * offset_id will be inclusive only if there is 'add_offset' <= -1 (-1 - will only include the 'offset_id')
|
|
|
|
if(offset_id && !mids.includes(offset_id) && offsetIdOffset < count) { |
|
|
|
// * check that offset_id is not 0
|
|
|
|
|
|
|
|
if(offset_id && appMessagesIdsManager.getServerMessageId(offset_id) && !mids.includes(offset_id) && offsetIdOffset < count) { |
|
|
|
let i = 0; |
|
|
|
let i = 0; |
|
|
|
for(const length = mids.length; i < length; ++i) { |
|
|
|
for(const length = mids.length; i < length; ++i) { |
|
|
|
if(offset_id > mids[i]) { |
|
|
|
if(offset_id > mids[i]) { |
|
|
|