pass the correct message id when there is an attachment on reply

This commit is contained in:
Reinaldo Neto 2023-05-19 18:32:42 -03:00
parent 58f73e1d09
commit 67ba3131e3
1 changed files with 8 additions and 1 deletions

View File

@ -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}
/>
<Fields attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
{loading ? (