Add an entry for event untrusted status into the encryption info view

This commit is contained in:
ismailgulek
2022-08-11 13:52:28 +03:00
parent 073eb73302
commit def793d2aa
@@ -192,6 +192,7 @@ static NSAttributedString *verticalWhitespace = nil;
NSString *claimedKey = _mxEvent.keysClaimed[@"ed25519"];
NSString *algorithm = _mxEvent.wireContent[@"algorithm"];
NSString *sessionId = _mxEvent.wireContent[@"session_id"];
NSString *untrusted = _mxEvent.isUntrusted ? [VectorL10n userVerificationSessionsListSessionUntrusted] : [VectorL10n userVerificationSessionsListSessionTrusted];
NSString *decryptionError;
if (_mxEvent.decryptionError)
@@ -277,6 +278,16 @@ static NSAttributedString *verticalWhitespace = nil;
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont systemFontOfSize:14]}]];
[eventInformationString appendAttributedString:[MXKEncryptionInfoView verticalWhitespace]];
[eventInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:[NSString stringWithFormat:@"%@\n", [VectorL10n sslTrust]]
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont boldSystemFontOfSize:14]}]];
[eventInformationString appendAttributedString:[[NSMutableAttributedString alloc]
initWithString:untrusted
attributes:@{NSForegroundColorAttributeName: _defaultTextColor,
NSFontAttributeName: [UIFont systemFontOfSize:14]}]];
[eventInformationString appendAttributedString:[MXKEncryptionInfoView verticalWhitespace]];
[textViewAttributedString appendAttributedString:eventInformationString];
}