Remove refs to MessageModel in conversations.ts

This commit is contained in:
Fedor Indutny 2024-07-25 16:29:49 -07:00 committed by GitHub
parent 2550af9c91
commit cc6ff0b554
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 312 additions and 357 deletions

View file

@ -2025,13 +2025,12 @@ export async function createGroupV2(
forceSave: true,
ourAci,
});
let model = new window.Whisper.Message(createdTheGroupMessage);
model = window.MessageCache.__DEPRECATED$register(
model.id,
model,
window.MessageCache.__DEPRECATED$register(
createdTheGroupMessage.id,
new window.Whisper.Message(createdTheGroupMessage),
'createGroupV2'
);
conversation.trigger('newmessage', model);
conversation.trigger('newmessage', createdTheGroupMessage);
if (expireTimer) {
await conversation.updateExpirationTimer(expireTimer, {
@ -3435,13 +3434,12 @@ async function appendChangeMessages(
continue;
}
let model = new window.Whisper.Message(changeMessage);
model = window.MessageCache.__DEPRECATED$register(
model.id,
model,
window.MessageCache.__DEPRECATED$register(
changeMessage.id,
new window.Whisper.Message(changeMessage),
'appendChangeMessages'
);
conversation.trigger('newmessage', model);
conversation.trigger('newmessage', changeMessage);
newMessages += 1;
}