Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No event decoration if no decryption result #7471

Merged
merged 1 commit into from
Apr 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,21 @@ - (EventEncryptionDecoration)encryptionDecorationForEvent:(MXEvent*)event roomSt

// 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;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,8 @@ - (void)updateTextViewText
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;
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-7471.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Timeline: No event decoration if no decryption result