diff --git a/src/app/components/message/modals/Options.tsx b/src/app/components/message/modals/Options.tsx index ce12ac7704..25def1c852 100644 --- a/src/app/components/message/modals/Options.tsx +++ b/src/app/components/message/modals/Options.tsx @@ -62,7 +62,10 @@ import { } from '$features/bookmarks'; import { CopyIcon } from '@phosphor-icons/react'; import * as OptionsCss from './Options.css'; -import { MATRIX_SABLE_UNSTABLE_FAVORITE_GIFS } from '$unstable/prefixes'; +import { + MATRIX_SABLE_UNSTABLE_FAVORITE_GIFS, + MATRIX_UNSTABLE_PER_MESSAGE_PROFILE_PROPERTY_NAME, +} from '$unstable/prefixes'; import { useFavoriteGifs } from '$hooks/useFavoriteGifs'; import type { IImageInfo } from '$types/matrix/common'; import { getIncomingMediaMxcUrl } from '../MsgTypeRenderers'; @@ -172,7 +175,8 @@ const MessageCopyTextItem = as< >(({ room, mEvent, onClose, ...props }, ref) => { const handleCopy = () => { const content = mEvent.getContent(); - const body = content?.body; + const pmp = content[MATRIX_UNSTABLE_PER_MESSAGE_PROFILE_PROPERTY_NAME]; + const body = pmp ? content?.body?.replace(`${pmp.displayname}: `, '') : content?.body; if (body) copyToClipboard(body); onClose();