1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-07 10:46:24 +03:00

Hide default encryption algorithm

When the default encryption algorithm is used, we hide it to remove some jargon
from the app. For any other algorithm, we continue showing it and add
"unrecognised".

Fixes https://github.com/vector-im/riot-web/issues/8829
This commit is contained in:
J. Ryan Stinnett
2020-01-24 17:53:30 +00:00
parent 1986f13275
commit bf0e1efce8
2 changed files with 15 additions and 5 deletions

View File

@@ -444,10 +444,19 @@ function textForHistoryVisibilityEvent(event) {
function textForEncryptionEvent(event) {
const senderName = event.sender ? event.sender.name : event.getSender();
return _t('%(senderName)s turned on end-to-end encryption (algorithm %(algorithm)s).', {
senderName,
algorithm: event.getContent().algorithm,
});
if (event.getContent().algorithm === "m.megolm.v1.aes-sha2") {
return _t('%(senderName)s turned on end-to-end encryption.', {
senderName,
});
}
return _t(
'%(senderName)s turned on end-to-end encryption ' +
'(unrecognised algorithm %(algorithm)s).',
{
senderName,
algorithm: event.getContent().algorithm,
},
);
}
// Currently will only display a change if a user's power level is changed