mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 16:42:44 +02:00
Simplify event encryption decoration
This commit is contained in:
@@ -187,7 +187,7 @@
|
||||
// Always show a warning badge if there was a decryption error.
|
||||
if (event.decryptionError)
|
||||
{
|
||||
return EventEncryptionDecorationDecryptionError;
|
||||
return EventEncryptionDecorationRed;
|
||||
}
|
||||
|
||||
// Unencrypted message events should show a warning unless they're pending local echoes
|
||||
@@ -199,29 +199,20 @@
|
||||
return EventEncryptionDecorationNone;
|
||||
}
|
||||
|
||||
return EventEncryptionDecorationNotEncrypted;
|
||||
return EventEncryptionDecorationRed;
|
||||
}
|
||||
|
||||
// The encryption is in a good state.
|
||||
// Only show a warning badge if there are trust issues.
|
||||
if (event.sender)
|
||||
// Only show a warning badge if there are decryption trust issues.
|
||||
switch (event.decryptionDecoration.color)
|
||||
{
|
||||
MXUserTrustLevel *userTrustLevel = [session.crypto trustLevelForUser:event.sender];
|
||||
MXDeviceInfo *deviceInfo = [session.crypto eventDeviceInfo:event];
|
||||
|
||||
if (userTrustLevel.isVerified && !deviceInfo.trustLevel.isVerified)
|
||||
{
|
||||
return EventEncryptionDecorationUntrustedDevice;
|
||||
}
|
||||
case MXEventDecryptionDecorationColorRed:
|
||||
return EventEncryptionDecorationRed;
|
||||
case MXEventDecryptionDecorationColorGrey:
|
||||
return EventEncryptionDecorationGrey;
|
||||
case MXEventDecryptionDecorationColorNone:
|
||||
return EventEncryptionDecorationNone;
|
||||
}
|
||||
|
||||
if (event.isUntrusted)
|
||||
{
|
||||
return EventEncryptionDecorationUnsafeKey;
|
||||
}
|
||||
|
||||
// Everything was fine
|
||||
return EventEncryptionDecorationNone;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user