From fb7da4f70c4fa8069e768231a0fc62ef118f3ce6 Mon Sep 17 00:00:00 2001 From: Reinaldo Neto Date: Tue, 4 Jul 2023 18:55:30 -0300 Subject: [PATCH] removed the necessity of messageId or id --- app/containers/message/Attachments.tsx | 13 ++----------- app/containers/message/Reply.tsx | 11 +---------- app/containers/message/interfaces.ts | 1 - 3 files changed, 3 insertions(+), 22 deletions(-) diff --git a/app/containers/message/Attachments.tsx b/app/containers/message/Attachments.tsx index 53326633d..378225a54 100644 --- a/app/containers/message/Attachments.tsx +++ b/app/containers/message/Attachments.tsx @@ -54,7 +54,7 @@ const AttachedActions = ({ attachment, getCustomEmoji }: { attachment: IAttachme }; const Attachments: React.FC = React.memo( - ({ attachments, timeFormat, showAttachment, style, getCustomEmoji, isReply, id, author }: IMessageAttachments) => { + ({ attachments, timeFormat, showAttachment, style, getCustomEmoji, isReply, author }: IMessageAttachments) => { const { theme } = useTheme(); if (!attachments || attachments.length === 0) { @@ -112,16 +112,7 @@ const Attachments: React.FC = React.memo( ); } - return ( - - ); + return ; }); return <>{attachmentsElements}; }, diff --git a/app/containers/message/Reply.tsx b/app/containers/message/Reply.tsx index 1bf0a56b2..f09653044 100644 --- a/app/containers/message/Reply.tsx +++ b/app/containers/message/Reply.tsx @@ -3,7 +3,6 @@ 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'; @@ -92,7 +91,6 @@ interface IMessageReply { timeFormat?: string; index: number; getCustomEmoji: TGetCustomEmoji; - messageId: string; } const Title = React.memo( @@ -199,7 +197,7 @@ const Fields = React.memo( ); const Reply = React.memo( - ({ attachment, timeFormat, index, getCustomEmoji, messageId }: IMessageReply) => { + ({ attachment, timeFormat, index, getCustomEmoji }: IMessageReply) => { const [loading, setLoading] = useState(false); const { theme } = useTheme(); const { baseUrl, user, jumpToMessage } = useContext(MessageContext); @@ -226,12 +224,6 @@ 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; @@ -264,7 +256,6 @@ const Reply = React.memo( timeFormat={timeFormat} style={[{ color: themes[theme].auxiliaryTintColor, fontSize: 14, marginBottom: 8 }]} isReply - id={attachmentId} /> {loading ? ( diff --git a/app/containers/message/interfaces.ts b/app/containers/message/interfaces.ts index a1f87f4df..448c5ad3d 100644 --- a/app/containers/message/interfaces.ts +++ b/app/containers/message/interfaces.ts @@ -14,7 +14,6 @@ export interface IMessageAttachments { isReply?: boolean; showAttachment?: (file: IAttachment) => void; getCustomEmoji: TGetCustomEmoji; - id: string; author?: IUserMessage; }