From 67ba3131e39e9e470a0304698f046d3687094bc0 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Fri, 19 May 2023 18:32:42 -0300 Subject: [PATCH] pass the correct message id when there is an attachment on reply --- app/containers/message/Reply.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/containers/message/Reply.tsx b/app/containers/message/Reply.tsx index 8c5fb6b88..1bf0a56b2 100644 --- a/app/containers/message/Reply.tsx +++ b/app/containers/message/Reply.tsx @@ -3,6 +3,7 @@ import { StyleSheet, Text, View } from 'react-native'; import moment from 'moment'; import { dequal } from 'dequal'; import FastImage from 'react-native-fast-image'; +import parse from 'url-parse'; import Touchable from './Touchable'; import Markdown from '../markdown'; @@ -225,6 +226,12 @@ const Reply = React.memo( openLink(url, theme); }; + let attachmentId = ''; + if (attachment.message_link) { + const parsedUrl = parse(attachment.message_link, true); + attachmentId = parsedUrl.query.msg || messageId; + } + let { borderColor } = themes[theme]; if (attachment.color) { borderColor = attachment.color; @@ -257,7 +264,7 @@ const Reply = React.memo( timeFormat={timeFormat} style={[{ color: themes[theme].auxiliaryTintColor, fontSize: 14, marginBottom: 8 }]} isReply - id={messageId} + id={attachmentId} /> {loading ? (