Improve message targeting for incoming reactions

This commit is contained in:
trevor-signal 2024-04-29 17:20:20 -04:00 committed by GitHub
parent f02a11bc9b
commit a0b4126b52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 769 additions and 180 deletions

View file

@ -70,7 +70,7 @@ import { shouldShowInvalidMessageToast } from '../../util/shouldShowInvalidMessa
import { writeDraftAttachment } from '../../util/writeDraftAttachment';
import { __DEPRECATED$getMessageById } from '../../messages/getMessageById';
import { canReply, isNormalBubble } from '../selectors/message';
import { getContactId } from '../../messages/helpers';
import { getAuthorId } from '../../messages/helpers';
import { getConversationSelector } from '../selectors/conversations';
import { enqueueReactionForSend } from '../../reactions/enqueueReactionForSend';
import { useBoundActions } from '../../hooks/useBoundActions';
@ -341,7 +341,7 @@ function scrollToQuotedMessage({
Boolean(
item.conversationId === conversationId &&
authorId &&
getContactId(item) === authorId
getAuthorId(item) === authorId
)
);

View file

@ -244,7 +244,7 @@ export type GetContactOptions = Pick<
'conversationSelector' | 'ourConversationId' | 'ourNumber' | 'ourAci'
>;
export function getContactId(
export function getAuthorId(
message: MessageWithUIFieldsType,
{
conversationSelector,
@ -704,7 +704,7 @@ export const getPropsForMessage = (
(message.reactions || []).find(re => re.fromId === ourConversationId) || {}
).emoji;
const authorId = getContactId(message, {
const authorId = getAuthorId(message, {
conversationSelector,
ourConversationId,
ourNumber,
@ -2096,7 +2096,7 @@ export const getMessageDetails = createSelector(
let conversationIds: Array<string>;
if (isIncoming(message)) {
conversationIds = [
getContactId(message, {
getAuthorId(message, {
conversationSelector,
ourConversationId,
ourNumber,