Merge pull request #7471 from vector-im/andy/event_shield

No event decoration if no decryption result
This commit is contained in:
Anderas
2023-04-04 08:28:35 +01:00
committed by GitHub
3 changed files with 17 additions and 8 deletions
@@ -204,14 +204,21 @@
// The encryption is in a good state.
// Only show a warning badge if there are decryption trust issues.
switch (event.decryptionDecoration.color)
if (event.decryptionDecoration)
{
case MXEventDecryptionDecorationColorRed:
return EventEncryptionDecorationRed;
case MXEventDecryptionDecorationColorGrey:
return EventEncryptionDecorationGrey;
case MXEventDecryptionDecorationColorNone:
return EventEncryptionDecorationNone;
switch (event.decryptionDecoration.color)
{
case MXEventDecryptionDecorationColorNone:
return EventEncryptionDecorationNone;
case MXEventDecryptionDecorationColorGrey:
return EventEncryptionDecorationGrey;
case MXEventDecryptionDecorationColorRed:
return EventEncryptionDecorationRed;
}
}
else
{
return EventEncryptionDecorationNone;
}
}
@@ -196,7 +196,8 @@ static NSAttributedString *verticalWhitespace = nil;
if (!safetyMessage)
{
// Use default copy if none is provided by the decryption decoration
safetyMessage = _mxEvent.decryptionDecoration.color != MXEventDecryptionDecorationColorNone ? [VectorL10n roomEventEncryptionInfoKeyAuthenticityNotGuaranteed] : [VectorL10n userVerificationSessionsListSessionTrusted];
BOOL isUntrusted = _mxEvent.decryptionDecoration && _mxEvent.decryptionDecoration.color != MXEventDecryptionDecorationColorNone;
safetyMessage = isUntrusted ? [VectorL10n roomEventEncryptionInfoKeyAuthenticityNotGuaranteed] : [VectorL10n userVerificationSessionsListSessionTrusted];
}
NSString *decryptionError;
+1
View File
@@ -0,0 +1 @@
Timeline: No event decoration if no decryption result