Skip to content

Commit

Permalink
[FIX] Always parse encrypted messages on client (#27092)
Browse files Browse the repository at this point in the history
  • Loading branch information
yash-rajpal authored Nov 8, 2022
1 parent ef93fac commit e2e465c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
3 changes: 0 additions & 3 deletions apps/meteor/app/e2e/client/rocketchat.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,10 +412,7 @@ class E2E extends Emitter {
e2e: 'done',
};

console.log('before quote', decryptedMessage);

const decryptedMessageWithQuote = await this.parseQuoteAttachment(decryptedMessage);
console.log('after quote', decryptedMessageWithQuote);

return decryptedMessageWithQuote;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { IMessage, isQuoteAttachment, isTranslatedMessage, MessageAttachment, MessageQuoteAttachment } from '@rocket.chat/core-typings';
import {
IMessage,
isE2EEMessage,
isOTRMessage,
isQuoteAttachment,
isTranslatedMessage,
MessageAttachment,
MessageQuoteAttachment,
} from '@rocket.chat/core-typings';
import { Options, parse, Root } from '@rocket.chat/message-parser';

import { isParsedMessage } from './isParsedMessage';
Expand Down Expand Up @@ -34,7 +42,10 @@ export const parseMessageTextToAstMarkdown = (

return {
...msg,
md: msg.md ?? textToMessageToken(text, parseOptions),
md:
isE2EEMessage(message) || isOTRMessage(message)
? textToMessageToken(text, parseOptions)
: msg.md ?? textToMessageToken(text, parseOptions),
...(msg.attachments && { attachments: parseMessageAttachments(msg.attachments, parseOptions) }),
};
};
Expand Down

0 comments on commit e2e465c

Please sign in to comment.