-
Notifications
You must be signed in to change notification settings - Fork 166
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
Warn the user when unverified user has changed their identity #3621
Conversation
…n the Url in any installed browser.
📱 Scan the QR code below to install the build (arm64 only) for this PR. |
9e01997
to
0fd275d
Compare
} | ||
is PermalinkData.FallbackLink, | ||
is PermalinkData.RoomEmailInviteLink -> { | ||
context.openUrlInExternalApp(url) | ||
activity.openUrlInChromeCustomTab(null, darkTheme, url) |
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.
Note: at some point, direct usage of openUrlInExternalApp
should be forbidden, but this is out of scope of this PR.
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, just a couple of suggestions.
) : Presenter<IdentityChangeState> { | ||
@Composable | ||
override fun present(): IdentityChangeState { | ||
val roomMemberIdentityStateChange = remember { |
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.
Couldn't this just use produceState
?
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.
Yes this would make more sense. Also use by
delegate when possible?
modifier: Modifier = Modifier, | ||
) { | ||
// Pick the first identity change to PinViolation | ||
val identityChange = state.roomMemberIdentityStateChanges.firstOrNull { |
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.
Maybe rename it to something like dangerousIdentityChange
or pinViolationIdentityChange
?
|
||
return IdentityChangeState( | ||
roomMemberIdentityStateChanges = roomMemberIdentityStateChange.value | ||
.filter { it.roomMember.userId !in ignoredUserIdChange.value } |
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.
I guess the list will never be large, but we are filtering on the main thread for every composition ^
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.
This code does not exist anymore, are you reviewing an old version?
) | ||
|
||
data class RoomMemberIdentityStateChange( | ||
val roomMember: RoomMember, |
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.
Could we create a specific data class instead of passing RoomMember
if we only need a few fields?
…the risk of useless recomposition. Also remove TypingNotificationStateForMessagesProvider which was not used anymore.
@ganfra @jmartinesp thanks for the fast review. I think I have handled all your remarks. |
Quality Gate passedIssues Measures |
Content
As per element-hq/element-meta#2544
Using matrix-org/matrix-rust-sdk#4022 and matrix-org/matrix-rust-sdk#4068
Draft since the application is crashing for now when clicking on OK to pin the user. EDIT The crash has been fixed in matrix-org/matrix-rust-sdk#4089 so an SDK release will be neeeded, but this is not blocking this PR anymore (pinning identity cannot be tested, but the PR can be reviewed).
Motivation and context
element-hq/element-meta#2544
Screenshots / GIFs
Tests
Tested devices
Checklist