Store all story reactions as messages

This commit is contained in:
Fedor Indutny 2022-11-02 16:48:38 -07:00 committed by GitHub
parent f13611712c
commit 54aa0d39b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 237 additions and 223 deletions

View file

@ -169,14 +169,15 @@ export class Reactions extends Collection<ReactionModel> {
);
// Use the generated message in ts/background.ts to create a message
// if the reaction is targetted at a story on a 1:1 conversation.
if (
isStory(targetMessage) &&
isDirectConversation(targetConversation.attributes)
) {
// if the reaction is targetted at a story.
if (isStory(targetMessage)) {
generatedMessage.set({
storyId: targetMessage.id,
storyReactionEmoji: reaction.get('emoji'),
storyReaction: {
emoji: reaction.get('emoji'),
targetAuthorUuid: reaction.get('targetAuthorUuid'),
targetTimestamp: reaction.get('targetTimestamp'),
},
});
// Note: generatedMessage comes with an id, so we have to force this save