Additional work to include story=true on send

This commit is contained in:
Scott Nonnenberg
2022-10-07 10:02:08 -07:00
committed by GitHub
parent 3bfeffe502
commit 4ec48df5b9
22 changed files with 327 additions and 170 deletions

View File

@@ -179,11 +179,13 @@ export class Reactions extends Collection<ReactionModel> {
storyReactionEmoji: reaction.get('emoji'),
});
const [generatedMessageId] = await Promise.all([
// Note: generatedMessage comes with an id, so we have to force this save
await Promise.all([
window.Signal.Data.saveMessage(generatedMessage.attributes, {
ourUuid: window.textsecure.storage.user
.getCheckedUuid()
.toString(),
forceSave: true,
}),
generatedMessage.hydrateStoryContext(message),
]);
@@ -197,10 +199,8 @@ export class Reactions extends Collection<ReactionModel> {
timestamp: reaction.get('timestamp'),
});
generatedMessage.set({ id: generatedMessageId });
const messageToAdd = window.MessageController.register(
generatedMessageId,
generatedMessage.id,
generatedMessage
);
targetConversation.addSingleMessage(messageToAdd);