Replace MessageController with MessageCache

This commit is contained in:
Josh Perez 2023-10-03 20:12:57 -04:00 committed by GitHub
parent ba1a8aad09
commit 7d35216fda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
73 changed files with 2237 additions and 1229 deletions

View file

@ -883,12 +883,13 @@ async function saveCallHistory(
});
log.info('saveCallHistory: Saved call history message:', id);
const model = window.MessageController.register(
const model = window.MessageCache.__DEPRECATED$register(
id,
new window.Whisper.Message({
...message,
id,
})
}),
'callDisposition'
);
if (callHistory.direction === CallDirection.Outgoing) {
@ -986,7 +987,7 @@ export async function clearCallHistoryDataAndSync(): Promise<void> {
const messageIds = await window.Signal.Data.clearCallHistory(timestamp);
messageIds.forEach(messageId => {
const message = window.MessageController.getById(messageId);
const message = window.MessageCache.__DEPRECATED$getById(messageId);
const conversation = message?.getConversation();
if (message == null || conversation == null) {
return;
@ -996,7 +997,7 @@ export async function clearCallHistoryDataAndSync(): Promise<void> {
message.get('conversationId')
);
conversation.debouncedUpdateLastMessage();
window.MessageController.unregister(messageId);
window.MessageCache.__DEPRECATED$unregister(messageId);
});
const ourAci = window.textsecure.storage.user.getCheckedAci();