Skip to content

Commit

Permalink
Hide decryption errors only for voice broadcast chunks.
Browse files Browse the repository at this point in the history
  • Loading branch information
nimau committed Jan 30, 2023
1 parent c0e5697 commit 8592560
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Riot/Modules/MatrixKit/Utils/EventFormatter/MXKEventFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -1053,8 +1053,17 @@ - (NSAttributedString *)attributedStringFromEvent:(MXEvent*)event
else if ([event.decryptionError.domain isEqualToString:MXDecryptingErrorDomain]
&& event.decryptionError.code == MXDecryptingErrorUnknownInboundSessionIdCode)
{
// Hide the decryption error for event related to another one (like voicebroadcast chunks)
// Hide the decryption error for VoiceBroadcast chunks
BOOL isVoiceBroadcastChunk = NO;
if ([event.relatesTo.relationType isEqualToString:MXEventRelationTypeReference]) {
MXEvent *startEvent = [mxSession.store eventWithEventId:event.relatesTo.eventId
inRoom:event.roomId];

if (startEvent) {
isVoiceBroadcastChunk = (startEvent.eventType == MXEventTypeCustom && [startEvent.type isEqualToString:VoiceBroadcastSettings.voiceBroadcastInfoContentKeyType]);
}
}
if (isVoiceBroadcastChunk) {
displayText = nil;
} else {
// Make the unknown inbound session id error description more user friendly
Expand Down

0 comments on commit 8592560

Please sign in to comment.