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

Iterate on user consent dialog for identity server #4587

Merged
merged 3 commits into from
Nov 30, 2021

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Nov 30, 2021

Implements #4577

New dialogs: #4577 (comment)

We need to retrieved the T&C, that's why many changes are necessary. Sadly there is some code duplication between the ViewModels, we may find a way to reduce that later.

@bmarty bmarty requested a review from ouchadam November 30, 2021 15:44
import org.matrix.android.sdk.api.session.Session
import org.matrix.android.sdk.api.session.terms.TermsService

suspend fun Session.fetchIdentityServerWithTerms(userLanguage: String): IdentityServerWithTerms? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 for lifting out of the view model

import im.vector.app.core.platform.VectorViewEvents
import im.vector.app.features.discovery.IdentityServerWithTerms

sealed class ContactsBookViewEvents : VectorViewEvents {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worlds smallest nit: could be a sealed interface, saves having to write () in the extends 😅

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think at the beginning of the project sealed interface was not a thing, but now, yes. I prefer to perform a global replace on a dedicated PR

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(created #4588 about it)

@@ -40,16 +45,36 @@ fun Context.displayInWebView(url: String) {
.show()
}

fun Context.showIdentityServerConsentDialog(configuredIdentityServer: String?, policyLinkCallback: () -> Unit, consentCallBack: (() -> Unit)) {
fun Context.showIdentityServerConsentDialog(identityServerWithTerms: IdentityServerWithTerms?,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

general question about identity servers, are privacy policies enforced?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean can we have an IS without any privacy policy? I do not think so, but the code should be robust to that.
By the way I will create some issues (defect, but no P1) I have seen in the area

Copy link
Contributor

@ouchadam ouchadam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@github-actions
Copy link

github-actions bot commented Nov 30, 2021

Unit Test Results

  66 files  ±0    66 suites  ±0   1m 3s ⏱️ +14s
135 tests ±0  135 ✔️ ±0  0 💤 ±0  0 ±0 
418 runs  ±0  418 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 9d6ac08. ± Comparison against base commit 8fd5e42.

♻️ This comment has been updated with latest results.

@bmarty
Copy link
Member Author

bmarty commented Nov 30, 2021

Just pushed a small commit

@bmarty bmarty enabled auto-merge November 30, 2021 16:47
@bmarty bmarty merged commit 3f39c5d into develop Nov 30, 2021
@bmarty bmarty deleted the feature/bma/is_consent branch November 30, 2021 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants