Adjust story replies for direct conversations

This commit is contained in:
Josh Perez 2022-05-10 15:02:21 -04:00 committed by GitHub
parent fa7b7fcd08
commit 0ca66d6e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 490 additions and 131 deletions

View file

@ -76,6 +76,7 @@ import {
import * as log from '../../logging/log';
import { getConversationColorAttributes } from '../../util/getConversationColorAttributes';
import { DAY, HOUR } from '../../util/durations';
import { getStoryReplyText } from '../../util/getStoryReplyText';
const THREE_HOURS = 3 * HOUR;
@ -435,7 +436,7 @@ export const getPropsForStoryReplyContext = createSelectorCreator(
(
message: Pick<
MessageWithUIFieldsType,
'body' | 'conversationId' | 'storyReplyContext'
'body' | 'conversationId' | 'storyReactionEmoji' | 'storyReplyContext'
>,
{
conversationSelector,
@ -445,14 +446,14 @@ export const getPropsForStoryReplyContext = createSelectorCreator(
ourConversationId?: string;
}
): PropsData['storyReplyContext'] => {
const { storyReplyContext } = message;
const { storyReactionEmoji, storyReplyContext } = message;
if (!storyReplyContext) {
return undefined;
}
const contact = conversationSelector(storyReplyContext.authorUuid);
const authorTitle = contact.title;
const authorTitle = contact.firstName || contact.title;
const isFromMe = contact.id === ourConversationId;
const conversation = getConversation(message, conversationSelector);
@ -464,10 +465,13 @@ export const getPropsForStoryReplyContext = createSelectorCreator(
authorTitle,
conversationColor,
customColor,
emoji: storyReactionEmoji,
isFromMe,
rawAttachment: storyReplyContext.attachment
? processQuoteAttachment(storyReplyContext.attachment)
: undefined,
referencedMessageNotFound: !storyReplyContext.messageId,
text: getStoryReplyText(window.i18n, storyReplyContext.attachment),
};
},