Do not confirm messages until we have handled them

This commit is contained in:
Josh Perez
2023-08-21 16:08:27 -04:00
committed by GitHub
parent 29aa188c0f
commit 04f716986c
16 changed files with 990 additions and 960 deletions

View File

@@ -1,9 +1,10 @@
// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import noop from 'lodash/noop';
import { v4 as generateUuid } from 'uuid';
import { ReactionModel } from '../messageModifiers/Reactions';
import type { ReactionAttributesType } from '../messageModifiers/Reactions';
import { ReactionSource } from './ReactionSource';
import { getMessageById } from '../messages/getMessageById';
import { getSourceServiceId, isStory } from '../messages/helpers';
@@ -98,7 +99,9 @@ export async function enqueueReactionForSend({
})
: undefined;
const reaction = new ReactionModel({
const reaction: ReactionAttributesType = {
envelopeId: generateUuid(),
removeFromMessageReceiverCache: noop,
emoji,
fromId: window.ConversationController.getOurConversationIdOrThrow(),
remove,
@@ -107,7 +110,7 @@ export async function enqueueReactionForSend({
targetAuthorAci,
targetTimestamp,
timestamp,
});
};
await message.handleReaction(reaction, { storyMessage });
}