mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-05-01 13:51:09 +01:00
Use minimal replacement class for MessageModel
This commit is contained in:
@@ -31,6 +31,8 @@ import { collect } from './iterables';
|
||||
import { DurationInSeconds } from './durations';
|
||||
import { sanitizeLinkPreview } from '../services/LinkPreview';
|
||||
import type { DraftBodyRanges } from '../types/BodyRange';
|
||||
import { postSaveUpdates } from './cleanup';
|
||||
import { MessageModel } from '../models/messages';
|
||||
|
||||
export async function sendStoryMessage(
|
||||
listIds: Array<string>,
|
||||
@@ -308,11 +310,7 @@ export async function sendStoryMessage(
|
||||
// * Add the message to the conversation
|
||||
await Promise.all(
|
||||
distributionListMessages.map(message => {
|
||||
window.MessageCache.__DEPRECATED$register(
|
||||
message.id,
|
||||
new window.Whisper.Message(message),
|
||||
'sendStoryMessage'
|
||||
);
|
||||
window.MessageCache.register(new MessageModel(message));
|
||||
|
||||
void ourConversation.addSingleMessage(message, { isJustSent: true });
|
||||
|
||||
@@ -320,6 +318,7 @@ export async function sendStoryMessage(
|
||||
return DataWriter.saveMessage(message, {
|
||||
forceSave: true,
|
||||
ourAci: window.textsecure.storage.user.getCheckedAci(),
|
||||
postSaveUpdates,
|
||||
});
|
||||
})
|
||||
);
|
||||
@@ -359,11 +358,7 @@ export async function sendStoryMessage(
|
||||
timestamp: messageAttributes.timestamp,
|
||||
},
|
||||
async jobToInsert => {
|
||||
window.MessageCache.__DEPRECATED$register(
|
||||
messageAttributes.id,
|
||||
new window.Whisper.Message(messageAttributes),
|
||||
'sendStoryMessage'
|
||||
);
|
||||
window.MessageCache.register(new MessageModel(messageAttributes));
|
||||
const conversation =
|
||||
window.ConversationController.get(conversationId);
|
||||
void conversation?.addSingleMessage(messageAttributes, {
|
||||
@@ -377,6 +372,7 @@ export async function sendStoryMessage(
|
||||
forceSave: true,
|
||||
jobToInsert,
|
||||
ourAci: window.textsecure.storage.user.getCheckedAci(),
|
||||
postSaveUpdates,
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user