Disable forward for messages with embedded contact

This commit is contained in:
Scott Nonnenberg 2022-04-11 13:57:44 -07:00 committed by GitHub
parent 6d816d01ad
commit 7f89f6162f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 442 additions and 185 deletions

View file

@ -48,6 +48,7 @@ export type DataPropsType = {
linkPreview?: LinkPreviewType
) => void;
getPreferredBadge: PreferredBadgeSelectorType;
hasContact: boolean;
i18n: LocalizerType;
isSticker: boolean;
linkPreview?: LinkPreviewType;
@ -79,6 +80,7 @@ export const ForwardMessageModal: FunctionComponent<PropsType> = ({
candidateConversations,
doForwardMessage,
getPreferredBadge,
hasContact,
i18n,
isSticker,
linkPreview,
@ -110,7 +112,7 @@ export const ForwardMessageModal: FunctionComponent<PropsType> = ({
const [messageBodyText, setMessageBodyText] = useState(messageBody || '');
const [cannotMessage, setCannotMessage] = useState(false);
const isMessageEditable = !isSticker;
const isMessageEditable = !isSticker && !hasContact;
const hasSelectedMaximumNumberOfContacts =
selectedContacts.length >= MAX_FORWARD;
@ -142,6 +144,7 @@ export const ForwardMessageModal: FunctionComponent<PropsType> = ({
hasContactsSelected &&
(Boolean(messageBodyText) ||
isSticker ||
hasContact ||
(attachmentsToForward && attachmentsToForward.length));
const forwardMessage = React.useCallback(() => {