Skip to content

Commit 03cac4f

Browse files
authored
feat: Includes attachments metadata in JSON when exporting messages (#35113)
1 parent c3c2725 commit 03cac4f

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@rocket.chat/meteor': minor
3+
---
4+
5+
Includes attachments metadata in JSON export if type is file when exporting messages

apps/meteor/client/views/room/contextualBar/ExportMessages/useDownloadExportMutation.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,29 @@ import { Messages } from '../../../../../app/models/client';
88
import { downloadJsonAs } from '../../../../lib/download';
99
import { useRoom } from '../../contexts/RoomContext';
1010

11-
const messagesFields: FindOptions<IMessage> = { projection: { _id: 1, ts: 1, u: 1, msg: 1, _updatedAt: 1, tlm: 1, replies: 1, tmid: 1 } };
11+
const messagesFields: FindOptions<IMessage> = {
12+
projection: {
13+
'_id': 1,
14+
'ts': 1,
15+
'u': 1,
16+
'msg': 1,
17+
'_updatedAt': 1,
18+
'tlm': 1,
19+
'replies': 1,
20+
'tmid': 1,
21+
'attachments.ts': 1,
22+
'attachments.title': 1,
23+
'attachments.title_link': 1,
24+
'attachments.title_link_download': 1,
25+
'attachments.image_dimensions': 1,
26+
'attachments.image_preview': 1,
27+
'attachments.image_url': 1,
28+
'attachments.image_type': 1,
29+
'attachments.image_size': 1,
30+
'attachments.type': 1,
31+
'attachments.description': 1,
32+
},
33+
};
1234

1335
export const useDownloadExportMutation = () => {
1436
const { t } = useTranslation();

0 commit comments

Comments
 (0)