Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
circles-android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Circles
circles-android
Commits
00ddff5e
Commit
00ddff5e
authored
1 year ago
by
Taras
Browse files
Options
Downloads
Patches
Plain Diff
Update validate email ds
parent
25bc762b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
auth/src/main/java/org/futo/circles/auth/feature/sign_up/validate_email/ValidateEmailDataSource.kt
+10
-9
10 additions, 9 deletions
...feature/sign_up/validate_email/ValidateEmailDataSource.kt
with
10 additions
and
9 deletions
auth/src/main/java/org/futo/circles/auth/feature/sign_up/validate_email/ValidateEmailDataSource.kt
+
10
−
9
View file @
00ddff5e
package
org.futo.circles.auth.feature.sign_up.validate_email
package
org.futo.circles.auth.feature.sign_up.validate_email
import
org.futo.circles.auth.feature.sign_up.SignUpDataSource
import
org.futo.circles.auth.feature.uia.UIADataSource.Companion.REGISTRATION_EMAIL_REQUEST_TOKEN_TYPE
import
org.futo.circles.auth.feature.sign_up.SignUpDataSource.Companion.REGISTRATION_EMAIL_REQUEST_TOKEN_TYPE
import
org.futo.circles.auth.feature.uia.UIADataSource.Companion.REGISTRATION_EMAIL_SUBMIT_TOKEN_TYPE
import
org.futo.circles.auth.feature.sign_up.SignUpDataSource.Companion.REGISTRATION_EMAIL_SUBMIT_TOKEN_TYPE
import
org.futo.circles.auth.feature.uia.UIADataSource.Companion.TYPE_PARAM_KEY
import
org.futo.circles.auth.feature.uia.UIADataSourceProvider
import
org.futo.circles.core.extensions.Response
import
org.futo.circles.core.extensions.Response
import
org.matrix.android.sdk.api.auth.registration.RegistrationResult
import
org.matrix.android.sdk.api.auth.registration.RegistrationResult
import
org.matrix.android.sdk.api.auth.registration.Stage
import
org.matrix.android.sdk.api.auth.registration.Stage
import
javax.inject.Inject
import
javax.inject.Inject
class
ValidateEmailDataSource
@Inject
constructor
(
class
ValidateEmailDataSource
@Inject
constructor
(
)
{
private
val
signUpDataSource
:
SignUpDataSource
)
{
private
val
uiaDataSource
=
UIADataSourceProvider
.
getDataSourceOrThrow
()
suspend
fun
sendValidationCode
(
suspend
fun
sendValidationCode
(
email
:
String
,
email
:
String
,
subscribeToUpdates
:
Boolean
subscribeToUpdates
:
Boolean
):
Response
<
RegistrationResult
>
=
signUp
DataSource
.
perform
Registration
Stage
(
):
Response
<
RegistrationResult
>
=
uia
DataSource
.
perform
UIA
Stage
(
mapOf
(
mapOf
(
TYPE_PARAM_KEY
to
REGISTRATION_EMAIL_REQUEST_TOKEN_TYPE
,
TYPE_PARAM_KEY
to
REGISTRATION_EMAIL_REQUEST_TOKEN_TYPE
,
EMAIL_PARAM_KEY
to
email
,
EMAIL_PARAM_KEY
to
email
,
...
@@ -24,7 +25,7 @@ class ValidateEmailDataSource @Inject constructor(
...
@@ -24,7 +25,7 @@ class ValidateEmailDataSource @Inject constructor(
)
)
suspend
fun
validateEmail
(
code
:
String
):
Response
<
RegistrationResult
>
=
suspend
fun
validateEmail
(
code
:
String
):
Response
<
RegistrationResult
>
=
signUp
DataSource
.
perform
Registration
Stage
(
uia
DataSource
.
perform
UIA
Stage
(
mapOf
(
mapOf
(
TYPE_PARAM_KEY
to
REGISTRATION_EMAIL_SUBMIT_TOKEN_TYPE
,
TYPE_PARAM_KEY
to
REGISTRATION_EMAIL_SUBMIT_TOKEN_TYPE
,
TOKEN_PARAM_KEY
to
code
TOKEN_PARAM_KEY
to
code
...
@@ -32,7 +33,7 @@ class ValidateEmailDataSource @Inject constructor(
...
@@ -32,7 +33,7 @@ class ValidateEmailDataSource @Inject constructor(
)
)
fun
shouldShowSubscribeToEmail
():
Boolean
=
fun
shouldShowSubscribeToEmail
():
Boolean
=
(
signUp
DataSource
.
currentStage
as
?
Stage
.
Other
)
?.
params
?.
get
(
OFFER_LIST_SUBSCRIPTION_KEY
)
as
?
Boolean
(
uia
DataSource
.
currentStage
as
?
Stage
.
Other
)
?.
params
?.
get
(
OFFER_LIST_SUBSCRIPTION_KEY
)
as
?
Boolean
?:
false
?:
false
companion
object
{
companion
object
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment