From d0ab37ac50658c12a0a388f1cd20f66fe7c2fd49 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 31 Jan 2020 09:58:21 +0000 Subject: [PATCH] Only say the room is encrypted if it actually is --- src/components/views/messages/EncryptionEvent.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/views/messages/EncryptionEvent.js b/src/components/views/messages/EncryptionEvent.js index e161d050f1..ab0f3fde2e 100644 --- a/src/components/views/messages/EncryptionEvent.js +++ b/src/components/views/messages/EncryptionEvent.js @@ -17,6 +17,7 @@ limitations under the License. import React from 'react'; import PropTypes from 'prop-types'; import { _t } from '../../../languageHandler'; +import { MatrixClientPeg } from '../../../MatrixClientPeg'; export default class EncryptionEvent extends React.Component { render() { @@ -24,7 +25,10 @@ export default class EncryptionEvent extends React.Component { let body; let classes = "mx_EventTile_bubble mx_cryptoEvent mx_cryptoEvent_icon"; - if (mxEvent.getContent().algorithm === 'm.megolm.v1.aes-sha2') { + if ( + mxEvent.getContent().algorithm === 'm.megolm.v1.aes-sha2' && + MatrixClientPeg.get().isRoomEncrypted(mxEvent.getRoomId()) + ) { body =
{_t("Encryption enabled")}