-
Notifications
You must be signed in to change notification settings - Fork 187
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
Incoming session verification #3733
Changes from 5 commits
b8b3820
d4bcbd4
f508f3e
d83c098
229f843
f03a432
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.features.verifysession.api | ||
|
||
import com.bumble.appyx.core.modality.BuildContext | ||
import com.bumble.appyx.core.node.Node | ||
import com.bumble.appyx.core.plugin.Plugin | ||
import io.element.android.libraries.architecture.FeatureEntryPoint | ||
import io.element.android.libraries.architecture.NodeInputs | ||
import io.element.android.libraries.matrix.api.verification.SessionVerificationRequestDetails | ||
|
||
interface IncomingVerificationEntryPoint : FeatureEntryPoint { | ||
data class Params( | ||
val sessionVerificationRequestDetails: SessionVerificationRequestDetails, | ||
) : NodeInputs | ||
Check warning on line 20 in features/verifysession/api/src/main/kotlin/io/element/android/features/verifysession/api/IncomingVerificationEntryPoint.kt
|
||
|
||
fun nodeBuilder(parentNode: Node, buildContext: BuildContext): NodeBuilder | ||
|
||
interface NodeBuilder { | ||
fun callback(callback: Callback): NodeBuilder | ||
fun params(params: Params): NodeBuilder | ||
fun build(): Node | ||
} | ||
|
||
interface Callback : Plugin { | ||
fun onDone() | ||
} | ||
} |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.features.verifysession.impl.incoming | ||
|
||
import com.bumble.appyx.core.modality.BuildContext | ||
import com.bumble.appyx.core.node.Node | ||
import com.bumble.appyx.core.plugin.Plugin | ||
import com.squareup.anvil.annotations.ContributesBinding | ||
import io.element.android.features.verifysession.api.IncomingVerificationEntryPoint | ||
import io.element.android.libraries.architecture.createNode | ||
import io.element.android.libraries.di.AppScope | ||
import javax.inject.Inject | ||
|
||
@ContributesBinding(AppScope::class) | ||
class DefaultIncomingVerificationEntryPoint @Inject constructor() : IncomingVerificationEntryPoint { | ||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): IncomingVerificationEntryPoint.NodeBuilder { | ||
val plugins = ArrayList<Plugin>() | ||
Check warning on line 22 in features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/incoming/DefaultIncomingVerificationEntryPoint.kt
|
||
|
||
return object : IncomingVerificationEntryPoint.NodeBuilder { | ||
Check warning on line 24 in features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/incoming/DefaultIncomingVerificationEntryPoint.kt
|
||
override fun callback(callback: IncomingVerificationEntryPoint.Callback): IncomingVerificationEntryPoint.NodeBuilder { | ||
plugins += callback | ||
return this | ||
Check warning on line 27 in features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/incoming/DefaultIncomingVerificationEntryPoint.kt
|
||
} | ||
|
||
override fun params(params: IncomingVerificationEntryPoint.Params): IncomingVerificationEntryPoint.NodeBuilder { | ||
plugins += params | ||
return this | ||
Check warning on line 32 in features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/incoming/DefaultIncomingVerificationEntryPoint.kt
|
||
} | ||
|
||
override fun build(): Node { | ||
return parentNode.createNode<IncomingVerificationNode>(buildContext, plugins) | ||
Check warning on line 36 in features/verifysession/impl/src/main/kotlin/io/element/android/features/verifysession/impl/incoming/DefaultIncomingVerificationEntryPoint.kt
|
||
} | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright 2024 New Vector Ltd. | ||
* | ||
* SPDX-License-Identifier: AGPL-3.0-only | ||
* Please see LICENSE in the repository root for full details. | ||
*/ | ||
|
||
package io.element.android.features.verifysession.impl.incoming | ||
|
||
fun interface IncomingVerificationNavigator { | ||
fun onFinish() | ||
} |
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 we should find another name than Navigator, as
onFinish
is not really a navigation event?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... But it will lead to a navigation. Do you have a suggestion for better name?
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.
On iOS they're using the
Coordinator
name, but not sure it's better :)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.
That's a very iOS-y name, but it kind of works here.