diff --git a/.changeset/proud-mayflies-invite.md b/.changeset/proud-mayflies-invite.md new file mode 100644 index 0000000000000..292fd11867a1e --- /dev/null +++ b/.changeset/proud-mayflies-invite.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Includes attachments metadata in JSON export if type is file when exporting messages diff --git a/apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts b/apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts index f35f153da8bb5..c1ce80e50e34f 100644 --- a/apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts +++ b/apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts @@ -8,7 +8,29 @@ import { Messages } from '../../../../../app/models/client'; import { downloadJsonAs } from '../../../../lib/download'; import { useRoom } from '../../contexts/RoomContext'; -const messagesFields: FindOptions = { projection: { _id: 1, ts: 1, u: 1, msg: 1, _updatedAt: 1, tlm: 1, replies: 1, tmid: 1 } }; +const messagesFields: FindOptions = { + projection: { + '_id': 1, + 'ts': 1, + 'u': 1, + 'msg': 1, + '_updatedAt': 1, + 'tlm': 1, + 'replies': 1, + 'tmid': 1, + 'attachments.ts': 1, + 'attachments.title': 1, + 'attachments.title_link': 1, + 'attachments.title_link_download': 1, + 'attachments.image_dimensions': 1, + 'attachments.image_preview': 1, + 'attachments.image_url': 1, + 'attachments.image_type': 1, + 'attachments.image_size': 1, + 'attachments.type': 1, + 'attachments.description': 1, + }, +}; export const useDownloadExportMutation = () => { const { t } = useTranslation();