code review

This commit is contained in:
Valere 2022-01-03 09:52:42 +01:00
parent b10bc7000a
commit 57b78a6223
2 changed files with 21 additions and 7 deletions

View File

@ -120,15 +120,29 @@ class RoomProfileController @Inject constructor(
}
var encryptionMisconfigured = false
val learnMoreSubtitle = if (roomSummary.isEncrypted) {
val e2eInfoText = if (roomSummary.isEncrypted) {
if (roomSummary.roomEncryptionAlgorithm is RoomEncryptionAlgorithm.SupportedAlgorithm) {
if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_subtitle else R.string.room_profile_encrypted_subtitle
stringProvider.getString(
if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_subtitle
else R.string.room_profile_encrypted_subtitle
)
} else {
encryptionMisconfigured = true
if (roomSummary.isDirect) R.string.direct_room_profile_encrypted_misconfigured_subtitle else R.string.room_profile_encrypted_misconfigured_subtitle
buildString {
append(stringProvider.getString(R.string.encryption_has_been_misconfigured))
append(" ")
apply {
if (!data.canUpdateRoomState) {
append(stringProvider.getString(R.string.contact_admin_to_restore_encryption))
}
}
}
}
} else {
if (roomSummary.isDirect) R.string.direct_room_profile_not_encrypted_subtitle else R.string.room_profile_not_encrypted_subtitle
stringProvider.getString(
if (roomSummary.isDirect) R.string.direct_room_profile_not_encrypted_subtitle
else R.string.room_profile_not_encrypted_subtitle
)
}
genericFooterItem {
id("e2e info")
@ -143,7 +157,7 @@ class RoomProfileController @Inject constructor(
+" "
}
}
+host.stringProvider.getString(learnMoreSubtitle)
+e2eInfoText
}
)
}

View File

@ -2792,8 +2792,8 @@
<string name="room_profile_not_encrypted_subtitle">Messages in this room are not end-to-end encrypted.</string>
<string name="direct_room_profile_not_encrypted_subtitle">Messages here are not end-to-end encrypted.</string>
<string name="room_profile_encrypted_subtitle">Messages in this room are end-to-end encrypted.\n\nYour messages are secured with locks and only you and the recipient have the unique keys to unlock them.</string>
<string name="room_profile_encrypted_misconfigured_subtitle">Encryption has been misconfigured. Please contact an admin to restore the room to a valid state.</string>
<string name="direct_room_profile_encrypted_misconfigured_subtitle">Encryption has been misconfigured. Please contact an admin to restore room.</string>
<string name="encryption_has_been_misconfigured">Encryption has been misconfigured.</string>
<string name="contact_admin_to_restore_encryption">Please contact an admin to restore encryption to a valid state.</string>
<string name="direct_room_profile_encrypted_subtitle">Messages here are end-to-end encrypted.\n\nYour messages are secured with locks and only you and the recipient have the unique keys to unlock them.</string>
<string name="room_profile_section_security">Security</string>
<string name="room_profile_section_restore_security">Restore Encryption</string>