-
Notifications
You must be signed in to change notification settings - Fork 748
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
Support misconfigured room encryption #4726
Conversation
b861fba
to
4bc0d07
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, some small remarks.
...dk-android/src/main/java/org/matrix/android/sdk/api/session/room/crypto/RoomCryptoService.kt
Show resolved
Hide resolved
...droid/src/main/java/org/matrix/android/sdk/api/session/room/model/RoomEncryptionAlgorithm.kt
Show resolved
Hide resolved
@@ -43,9 +43,23 @@ sealed interface SendMode { | |||
data class Voice(val text: String) : SendMode | |||
} | |||
|
|||
sealed class CanSendStatus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use sealed interface
now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
vector/src/main/java/im/vector/app/features/roommemberprofile/RoomMemberProfileViewState.kt
Show resolved
Hide resolved
obeservePowerLevels() | ||
} | ||
|
||
private fun obeservePowerLevels() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
vector/src/main/java/im/vector/app/features/roomprofile/RoomProfileViewModel.kt
Show resolved
Hide resolved
@@ -959,6 +959,7 @@ | |||
<string name="room_delete_unsent_messages">Delete unsent messages</string> | |||
<string name="room_message_file_not_found">File not found</string> | |||
<string name="room_do_not_have_permission_to_post">You do not have permission to post to this room.</string> | |||
<string name="room_unsupported_e2e_algorithm">Encryption has been misconfigured. You can\'t send messages, please contact an admin to restore the room to a valid state.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we show this message even when the user IS an admin?
If yes, we could probably add a way to open the settings in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You added a way to open the setting, but maybe also update the message for admins to:
Encryption has been misconfigured. You can\'t send messages. Click to open the settings to restore the room to a valid state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@amshakal Could you please review and provide copy/icons updates. Idealy a link to a figma in element-hq/element-meta#69 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. LGTM!
Just a small though, which should happen rarely: will it be possible to use the quick reply from a notification to send a message to a mis-configured room?
-> Maybe block the send message API at the SDK level and not only on the UI ?
@@ -2795,8 +2797,11 @@ | |||
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please contact an admin to restore the room to a valid state
should not be displayed if the user is actually an admin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated
@@ -2795,8 +2797,11 @@ | |||
<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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
0a31de7
to
3f780cf
Compare
Linked to design: element-hq/element-meta#69 |
The sending will fail at SDK level with an unable to encrypt error. But I'll look if I can disable the quick reply action if room is missconfigured |
Please also fix:
|
c56c264
to
f326710
Compare
Ktlint Results👍 ✅ 👍 |
Fixed |
9b61fca
to
d999bfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a last remark about database migration.
@@ -413,5 +415,29 @@ internal class RealmSessionStoreMigration @Inject constructor( | |||
chunkEntities.deleteAllFromRealm() | |||
} | |||
} | |||
|
|||
realm.schema.get("RoomSummaryEntity") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a migrateTo21()
fun to avoid breaking database for people using latest develop version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done + rebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
4dd7b4d
to
dc6030f
Compare
dc6030f
to
60ae416
Compare
Can someone post screenshots? I can review it then :) |
Fixes #4711
Better handlind of misconfigured encryption in room.
More details here element-hq/element-meta#69
When encryption is misconfigured the text composer will be disabled to deny sending (would fail anyhow)
Admin would have a button in settings to restore encryption