Inform the user about decryption errors during a voice broadcast

This commit is contained in:
Nicolas Mauri
2023-01-23 16:17:33 +01:00
parent b2711330ec
commit 70325c38e5
10 changed files with 120 additions and 15 deletions
@@ -1053,8 +1053,13 @@ static NSString *const kRepliedTextPattern = @"<mx-reply>.*<blockquote>.*<br>(.*
else if ([event.decryptionError.domain isEqualToString:MXDecryptingErrorDomain]
&& event.decryptionError.code == MXDecryptingErrorUnknownInboundSessionIdCode)
{
// Make the unknown inbound session id error description more user friendly
errorDescription = [VectorL10n noticeCryptoErrorUnknownInboundSessionId];
// Hide the decryption error for event related to another one (like voicebroadcast chunks)
if ([event.relatesTo.relationType isEqualToString:MXEventRelationTypeReference]) {
displayText = nil;
} else {
// Make the unknown inbound session id error description more user friendly
errorDescription = [VectorL10n noticeCryptoErrorUnknownInboundSessionId];
}
}
else if ([event.decryptionError.domain isEqualToString:MXDecryptingErrorDomain]
&& event.decryptionError.code == MXDecryptingErrorDuplicateMessageIndexCode)