Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .changeset/healthy-colts-notice.md

This file was deleted.

8 changes: 3 additions & 5 deletions apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
isQuoteAttachment,
isTranslatedAttachment,
isTranslatedMessage,
isEncryptedMessageAttachment,
} from '@rocket.chat/core-typings';
import type { Options, Root } from '@rocket.chat/message-parser';
import { parse } from '@rocket.chat/message-parser';
Expand Down Expand Up @@ -78,10 +77,9 @@ export const parseMessageAttachment = <T extends MessageAttachment>(
'';

if (isFileAttachment(attachment) && attachment.description) {
attachment.descriptionMd =
translated || isEncryptedMessageAttachment(attachment)
? textToMessageToken(text, parseOptions)
: (attachment.descriptionMd ?? textToMessageToken(text, parseOptions));
attachment.descriptionMd = translated
? textToMessageToken(text, parseOptions)
: (attachment.descriptionMd ?? textToMessageToken(text, parseOptions));
}

return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ test.describe('E2EE File Encryption', () => {
await page.goto('/home');
});

test('File and description encryption and editing the description', async ({ page }) => {
test('File and description encryption', async ({ page }) => {
await test.step('create an encrypted channel', async () => {
const channelName = faker.string.uuid();

Expand All @@ -59,18 +59,6 @@ test.describe('E2EE File Encryption', () => {
await expect(poHomeChannel.content.getFileDescription).toHaveText('any_description');
await expect(poHomeChannel.content.lastMessageFileName).toContainText('any_file1.txt');
});

await test.step('edit the description', async () => {
await poHomeChannel.content.openLastMessageMenu();
await poHomeChannel.content.btnOptionEditMessage.click();

expect(await poHomeChannel.composer.inputValue()).toBe('any_description');

await poHomeChannel.content.inputMessage.fill('edited any_description');
await page.keyboard.press('Enter');

await expect(poHomeChannel.content.getFileDescription).toHaveText('edited any_description');
});
});

test('File encryption with whitelisted and blacklisted media types', async ({ page, api }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,3 @@ export type MessageAttachmentBase = {
sha256: string;
};
};

export type EncryptedMessageAttachment = MessageAttachmentBase & {
encryption: Required<MessageAttachmentBase>['encryption'];
};

export const isEncryptedMessageAttachment = (attachment: MessageAttachmentBase): attachment is EncryptedMessageAttachment => {
return attachment?.encryption !== undefined && typeof attachment.encryption === 'object';
};