Fixes after rebase
This commit is contained in:
parent
2fd9eaf17f
commit
8f09fd62d9
117 changed files with 310 additions and 295 deletions
|
|
@ -14,7 +14,7 @@ import dev.zacsweers.metro.AppScope
|
||||||
import dev.zacsweers.metro.ContributesBinding
|
import dev.zacsweers.metro.ContributesBinding
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
import io.element.android.libraries.deeplink.api.DeepLinkCreator
|
import io.element.android.libraries.deeplink.api.DeepLinkCreator
|
||||||
import io.element.android.libraries.di.ApplicationContext
|
import io.element.android.libraries.di.annotations.ApplicationContext
|
||||||
import io.element.android.libraries.matrix.api.core.RoomId
|
import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
import io.element.android.libraries.matrix.api.core.SessionId
|
import io.element.android.libraries.matrix.api.core.SessionId
|
||||||
import io.element.android.libraries.matrix.api.core.ThreadId
|
import io.element.android.libraries.matrix.api.core.ThreadId
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultAnalyticsEntryPoint() : AnalyticsEntryPoint {
|
class DefaultAnalyticsEntryPoint : AnalyticsEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
||||||
return parentNode.createNode<AnalyticsOptInNode>(buildContext)
|
return parentNode.createNode<AnalyticsOptInNode>(buildContext)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ interface LanguageTagProvider {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLanguageTagProvider() : LanguageTagProvider {
|
class DefaultLanguageTagProvider : LanguageTagProvider {
|
||||||
@Composable
|
@Composable
|
||||||
override fun provideLanguageTag(): String? {
|
override fun provideLanguageTag(): String? {
|
||||||
return LocalConfiguration.current.locales.get(0)?.toLanguageTag()
|
return LocalConfiguration.current.locales.get(0)?.toLanguageTag()
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import androidx.core.net.toUri
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class CallIntentDataParser() {
|
class CallIntentDataParser {
|
||||||
private val validHttpSchemes = sequenceOf("https")
|
private val validHttpSchemes = sequenceOf("https")
|
||||||
private val knownHosts = sequenceOf(
|
private val knownHosts = sequenceOf(
|
||||||
"call.element.io",
|
"call.element.io",
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import io.element.android.libraries.matrix.api.widget.CallAnalyticCredentialsPro
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultCallAnalyticCredentialsProvider() : CallAnalyticCredentialsProvider {
|
class DefaultCallAnalyticCredentialsProvider : CallAnalyticCredentialsProvider {
|
||||||
override val posthogUserId: String? = BuildConfig.POSTHOG_USER_ID.takeIf { it.isNotBlank() }
|
override val posthogUserId: String? = BuildConfig.POSTHOG_USER_ID.takeIf { it.isNotBlank() }
|
||||||
override val posthogApiHost: String? = BuildConfig.POSTHOG_API_HOST.takeIf { it.isNotBlank() }
|
override val posthogApiHost: String? = BuildConfig.POSTHOG_API_HOST.takeIf { it.isNotBlank() }
|
||||||
override val posthogApiKey: String? = BuildConfig.POSTHOG_API_KEY.takeIf { it.isNotBlank() }
|
override val posthogApiKey: String? = BuildConfig.POSTHOG_API_KEY.takeIf { it.isNotBlank() }
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultCurrentCallService() : CurrentCallService {
|
class DefaultCurrentCallService : CurrentCallService {
|
||||||
override val currentCall = MutableStateFlow<CurrentCall>(CurrentCall.None)
|
override val currentCall = MutableStateFlow<CurrentCall>(CurrentCall.None)
|
||||||
|
|
||||||
fun onCallStarted(call: CurrentCall) {
|
fun onCallStarted(call: CurrentCall) {
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import io.element.android.libraries.matrix.api.room.JoinedRoom
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultChangeRoomMemberRolesEntyPoint() : ChangeRoomMemberRolesEntryPoint {
|
class DefaultChangeRoomMemberRolesEntyPoint : ChangeRoomMemberRolesEntryPoint {
|
||||||
override fun builder(parentNode: Node, buildContext: BuildContext): ChangeRoomMemberRolesEntryPoint.Builder {
|
override fun builder(parentNode: Node, buildContext: BuildContext): ChangeRoomMemberRolesEntryPoint.Builder {
|
||||||
return object : ChangeRoomMemberRolesEntryPoint.Builder {
|
return object : ChangeRoomMemberRolesEntryPoint.Builder {
|
||||||
private lateinit var changeRoomMemberRolesListType: ChangeRoomMemberRolesListType
|
private lateinit var changeRoomMemberRolesListType: ChangeRoomMemberRolesListType
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultCreateRoomEntryPoint() : CreateRoomEntryPoint {
|
class DefaultCreateRoomEntryPoint : CreateRoomEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreateRoomEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreateRoomEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultAccountDeactivationEntryPoint() : AccountDeactivationEntryPoint {
|
class DefaultAccountDeactivationEntryPoint : AccountDeactivationEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
||||||
return parentNode.createNode<AccountDeactivationNode>(buildContext)
|
return parentNode.createNode<AccountDeactivationNode>(buildContext)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import kotlinx.coroutines.flow.flowOf
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultEnterpriseService() : EnterpriseService {
|
class DefaultEnterpriseService : EnterpriseService {
|
||||||
override val isEnterpriseBuild = false
|
override val isEnterpriseBuild = false
|
||||||
|
|
||||||
override suspend fun isEnterpriseUser(sessionId: SessionId) = false
|
override suspend fun isEnterpriseUser(sessionId: SessionId) = false
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import io.element.android.libraries.di.SessionScope
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultSessionEnterpriseService() : SessionEnterpriseService {
|
class DefaultSessionEnterpriseService : SessionEnterpriseService {
|
||||||
override suspend fun init() = Unit
|
override suspend fun init() = Unit
|
||||||
override suspend fun isElementCallAvailable(): Boolean = true
|
override suspend fun isElementCallAvailable(): Boolean = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultFtueEntryPoint() : FtueEntryPoint {
|
class DefaultFtueEntryPoint : FtueEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): FtueEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): FtueEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultHomeEntryPoint() : HomeEntryPoint {
|
class DefaultHomeEntryPoint : HomeEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): HomeEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): HomeEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultFilterSelectionStrategy() : FilterSelectionStrategy {
|
class DefaultFilterSelectionStrategy : FilterSelectionStrategy {
|
||||||
private val selectedFilters = LinkedHashSet<RoomListFilter>()
|
private val selectedFilters = LinkedHashSet<RoomListFilter>()
|
||||||
|
|
||||||
override val filterSelectionStates = MutableStateFlow(buildFilters())
|
override val filterSelectionStates = MutableStateFlow(buildFilters())
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultAcceptDeclineInviteView() : AcceptDeclineInviteView {
|
class DefaultAcceptDeclineInviteView : AcceptDeclineInviteView {
|
||||||
@Composable
|
@Composable
|
||||||
override fun Render(
|
override fun Render(
|
||||||
state: AcceptDeclineInviteState,
|
state: AcceptDeclineInviteState,
|
||||||
|
|
|
||||||
|
|
@ -25,20 +25,20 @@ import io.element.android.libraries.di.SessionScope
|
||||||
class DeclineAndBlockNode(
|
class DeclineAndBlockNode(
|
||||||
@Assisted buildContext: BuildContext,
|
@Assisted buildContext: BuildContext,
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
// presenterFactory: DeclineAndBlockPresenter.Factory,
|
presenterFactory: DeclineAndBlockPresenter.Factory,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
data class Inputs(val inviteData: InviteData) : NodeInputs
|
data class Inputs(val inviteData: InviteData) : NodeInputs
|
||||||
|
|
||||||
private val inviteData = inputs<Inputs>().inviteData
|
private val inviteData = inputs<Inputs>().inviteData
|
||||||
// private val presenter = presenterFactory.create(inviteData)
|
private val presenter = presenterFactory.create(inviteData)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun View(modifier: Modifier) {
|
override fun View(modifier: Modifier) {
|
||||||
// val state = presenter.present()
|
val state = presenter.present()
|
||||||
// DeclineAndBlockView(
|
DeclineAndBlockView(
|
||||||
// state = state,
|
state = state,
|
||||||
// onBackClick = ::navigateUp,
|
onBackClick = ::navigateUp,
|
||||||
// modifier = modifier
|
modifier = modifier
|
||||||
// )
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultDeclineAndBlockEntryPoint() : DeclineInviteAndBlockEntryPoint {
|
class DefaultDeclineAndBlockEntryPoint : DeclineInviteAndBlockEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext, inviteData: InviteData): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext, inviteData: InviteData): Node {
|
||||||
val inputs = DeclineAndBlockNode.Inputs(inviteData)
|
val inputs = DeclineAndBlockNode.Inputs(inviteData)
|
||||||
return parentNode.createNode<DeclineAndBlockNode>(buildContext, plugins = listOf(inputs))
|
return parentNode.createNode<DeclineAndBlockNode>(buildContext, plugins = listOf(inputs))
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.di.SessionScope
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultInvitePeopleRenderer() : InvitePeopleRenderer {
|
class DefaultInvitePeopleRenderer : InvitePeopleRenderer {
|
||||||
@Composable
|
@Composable
|
||||||
override fun Render(state: InvitePeopleState, modifier: Modifier) {
|
override fun Render(state: InvitePeopleState, modifier: Modifier) {
|
||||||
if (state is DefaultInvitePeopleState) {
|
if (state is DefaultInvitePeopleState) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultJoinRoomEntryPoint() : JoinRoomEntryPoint {
|
class DefaultJoinRoomEntryPoint : JoinRoomEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext, inputs: JoinRoomEntryPoint.Inputs): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext, inputs: JoinRoomEntryPoint.Inputs): Node {
|
||||||
return parentNode.createNode<JoinRoomFlowNode>(
|
return parentNode.createNode<JoinRoomFlowNode>(
|
||||||
buildContext = buildContext,
|
buildContext = buildContext,
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultKnockRequestsListEntryPoint() : KnockRequestsListEntryPoint {
|
class DefaultKnockRequestsListEntryPoint : KnockRequestsListEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
||||||
return parentNode.createNode<KnockRequestsListNode>(buildContext)
|
return parentNode.createNode<KnockRequestsListNode>(buildContext)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class InternalLeaveRoomRenderer() : LeaveRoomRenderer {
|
class InternalLeaveRoomRenderer : LeaveRoomRenderer {
|
||||||
@Composable
|
@Composable
|
||||||
override fun Render(state: LeaveRoomState, onSelectNewOwners: (RoomId) -> Unit, modifier: Modifier) {
|
override fun Render(state: LeaveRoomState, onSelectNewOwners: (RoomId) -> Unit, modifier: Modifier) {
|
||||||
if (state is InternalLeaveRoomState) {
|
if (state is InternalLeaveRoomState) {
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultOpenSourcesLicensesEntryPoint() : OpenSourceLicensesEntryPoint {
|
class DefaultOpenSourcesLicensesEntryPoint : OpenSourceLicensesEntryPoint {
|
||||||
override fun getNode(node: Node, buildContext: BuildContext): Node {
|
override fun getNode(node: Node, buildContext: BuildContext): Node {
|
||||||
return node.createNode<DependenciesFlowNode>(buildContext)
|
return node.createNode<DependenciesFlowNode>(buildContext)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import io.element.android.features.location.api.LocationService
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLocationService() : LocationService {
|
class DefaultLocationService : LocationService {
|
||||||
override fun isServiceAvailable(): Boolean {
|
override fun isServiceAvailable(): Boolean {
|
||||||
return BuildConfig.MAPTILER_API_KEY.isNotEmpty()
|
return BuildConfig.MAPTILER_API_KEY.isNotEmpty()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.timeline.Timeline
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultSendLocationEntryPoint() : SendLocationEntryPoint {
|
class DefaultSendLocationEntryPoint : SendLocationEntryPoint {
|
||||||
override fun builder(timelineMode: Timeline.Mode): SendLocationEntryPoint.Builder {
|
override fun builder(timelineMode: Timeline.Mode): SendLocationEntryPoint.Builder {
|
||||||
return Builder(timelineMode)
|
return Builder(timelineMode)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultShowLocationEntryPoint() : ShowLocationEntryPoint {
|
class DefaultShowLocationEntryPoint : ShowLocationEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext, inputs: ShowLocationEntryPoint.Inputs): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext, inputs: ShowLocationEntryPoint.Inputs): Node {
|
||||||
return parentNode.createNode<ShowLocationNode>(buildContext, listOf(inputs))
|
return parentNode.createNode<ShowLocationNode>(buildContext, listOf(inputs))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLockScreenEntryPoint() : LockScreenEntryPoint {
|
class DefaultLockScreenEntryPoint : LockScreenEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext, navTarget: LockScreenEntryPoint.Target): LockScreenEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext, navTarget: LockScreenEntryPoint.Target): LockScreenEntryPoint.NodeBuilder {
|
||||||
val callbacks = mutableListOf<LockScreenEntryPoint.Callback>()
|
val callbacks = mutableListOf<LockScreenEntryPoint.Callback>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLoginEntryPoint() : LoginEntryPoint {
|
class DefaultLoginEntryPoint : LoginEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): LoginEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): LoginEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import io.element.android.features.login.api.LoginParams
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLoginIntentResolver() : LoginIntentResolver {
|
class DefaultLoginIntentResolver : LoginIntentResolver {
|
||||||
override fun parse(uriString: String): LoginParams? {
|
override fun parse(uriString: String): LoginParams? {
|
||||||
val uri = uriString.toUri()
|
val uri = uriString.toUri()
|
||||||
if (uri.host != "mobile.element.io") return null
|
if (uri.host != "mobile.element.io") return null
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.runtime.saveable.rememberSaveable
|
import androidx.compose.runtime.saveable.rememberSaveable
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
import io.element.android.features.login.impl.DefaultLoginUserStory
|
|
||||||
import io.element.android.features.login.impl.accountprovider.AccountProviderDataSource
|
import io.element.android.features.login.impl.accountprovider.AccountProviderDataSource
|
||||||
import io.element.android.libraries.architecture.AsyncData
|
import io.element.android.libraries.architecture.AsyncData
|
||||||
import io.element.android.libraries.architecture.Presenter
|
import io.element.android.libraries.architecture.Presenter
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,18 @@ package io.element.android.features.login.impl.screens.onboarding
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import com.squareup.anvil.annotations.ContributesBinding
|
import dev.zacsweers.metro.AppScope
|
||||||
import io.element.android.libraries.di.AppScope
|
import dev.zacsweers.metro.ContributesBinding
|
||||||
import io.element.android.libraries.di.ApplicationContext
|
import dev.zacsweers.metro.Inject
|
||||||
import javax.inject.Inject
|
import io.element.android.libraries.di.annotations.ApplicationContext
|
||||||
|
|
||||||
fun interface OnBoardingLogoResIdProvider {
|
fun interface OnBoardingLogoResIdProvider {
|
||||||
fun get(): Int?
|
fun get(): Int?
|
||||||
}
|
}
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultOnBoardingLogoResIdProvider @Inject constructor(
|
@Inject
|
||||||
|
class DefaultOnBoardingLogoResIdProvider(
|
||||||
@ApplicationContext private val context: Context,
|
@ApplicationContext private val context: Context,
|
||||||
) : OnBoardingLogoResIdProvider {
|
) : OnBoardingLogoResIdProvider {
|
||||||
@SuppressLint("DiscouragedApi")
|
@SuppressLint("DiscouragedApi")
|
||||||
|
|
|
||||||
|
|
@ -10,11 +10,10 @@ package io.element.android.features.login.impl.di
|
||||||
import com.bumble.appyx.core.modality.BuildContext
|
import com.bumble.appyx.core.modality.BuildContext
|
||||||
import com.bumble.appyx.core.node.Node
|
import com.bumble.appyx.core.node.Node
|
||||||
import com.bumble.appyx.core.plugin.Plugin
|
import com.bumble.appyx.core.plugin.Plugin
|
||||||
import io.element.android.features.login.impl.qrcode.FakeQrCodeLoginManager
|
|
||||||
import io.element.android.features.login.impl.qrcode.QrCodeLoginFlowNode
|
import io.element.android.features.login.impl.qrcode.QrCodeLoginFlowNode
|
||||||
import io.element.android.features.login.impl.qrcode.QrCodeLoginManager
|
import io.element.android.features.login.impl.qrcode.QrCodeLoginManager
|
||||||
import io.element.android.libraries.architecture.AssistedNodeFactory
|
import io.element.android.libraries.architecture.AssistedNodeFactory
|
||||||
import io.element.android.libraries.architecture.createNode
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
internal class FakeQrCodeLoginGraph(
|
internal class FakeQrCodeLoginGraph(
|
||||||
private val qrCodeLoginManager: QrCodeLoginManager,
|
private val qrCodeLoginManager: QrCodeLoginManager,
|
||||||
|
|
@ -23,7 +22,7 @@ internal class FakeQrCodeLoginGraph(
|
||||||
return mapOf(
|
return mapOf(
|
||||||
QrCodeLoginFlowNode::class to object : AssistedNodeFactory<QrCodeLoginFlowNode> {
|
QrCodeLoginFlowNode::class to object : AssistedNodeFactory<QrCodeLoginFlowNode> {
|
||||||
override fun create(buildContext: BuildContext, plugins: List<Plugin>): QrCodeLoginFlowNode {
|
override fun create(buildContext: BuildContext, plugins: List<Plugin>): QrCodeLoginFlowNode {
|
||||||
return createNode<QrCodeLoginFlowNode>(buildContext, plugins)
|
error("This factory should not be called in tests")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -33,9 +32,9 @@ internal class FakeQrCodeLoginGraph(
|
||||||
|
|
||||||
internal class Builder(
|
internal class Builder(
|
||||||
private val qrCodeLoginManager: QrCodeLoginManager,
|
private val qrCodeLoginManager: QrCodeLoginManager,
|
||||||
) : QrCodeLoginComponent.Factory {
|
) : QrCodeLoginGraph.Factory {
|
||||||
override fun create(): QrCodeLoginComponent {
|
override fun create(): QrCodeLoginGraph {
|
||||||
return FakeQrCodeLoginComponent(qrCodeLoginManager)
|
return FakeQrCodeLoginGraph(qrCodeLoginManager)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLogoutEntryPoint() : LogoutEntryPoint {
|
class DefaultLogoutEntryPoint : LogoutEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): LogoutEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): LogoutEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import io.element.android.libraries.di.SessionScope
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultDirectLogoutView() : DirectLogoutView {
|
class DefaultDirectLogoutView : DirectLogoutView {
|
||||||
@Composable
|
@Composable
|
||||||
override fun Render(state: DirectLogoutState) {
|
override fun Render(state: DirectLogoutState) {
|
||||||
val eventSink = state.eventSink
|
val eventSink = state.eventSink
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.room.draft.ComposerDraft
|
||||||
* Currently it's used to store draft message when moving to edit mode.
|
* Currently it's used to store draft message when moving to edit mode.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
class VolatileComposerDraftStore() : ComposerDraftStore {
|
class VolatileComposerDraftStore : ComposerDraftStore {
|
||||||
private val drafts: MutableMap<String, ComposerDraft> = mutableMapOf()
|
private val drafts: MutableMap<String, ComposerDraft> = mutableMapOf()
|
||||||
|
|
||||||
override suspend fun loadDraft(roomId: RoomId, threadRoot: ThreadId?): ComposerDraft? {
|
override suspend fun loadDraft(roomId: RoomId, threadRoot: ThreadId?): ComposerDraft? {
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ interface LinkChecker {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultLinkChecker() : LinkChecker {
|
class DefaultLinkChecker : LinkChecker {
|
||||||
override fun isSafe(link: Link): Boolean {
|
override fun isSafe(link: Link): Boolean {
|
||||||
return if (link.url.containsRtLOverride()) {
|
return if (link.url.containsRtLOverride()) {
|
||||||
false
|
false
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import io.element.android.libraries.textcomposer.model.MessageComposerMode
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
@ContributesBinding(RoomScope::class)
|
@ContributesBinding(RoomScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultMessageComposerContext() : MessageComposerContext {
|
class DefaultMessageComposerContext : MessageComposerContext {
|
||||||
override var composerMode: MessageComposerMode by mutableStateOf(MessageComposerMode.Normal)
|
override var composerMode: MessageComposerMode by mutableStateOf(MessageComposerMode.Normal)
|
||||||
internal set
|
internal set
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ interface RichTextEditorStateFactory {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultRichTextEditorStateFactory() : RichTextEditorStateFactory {
|
class DefaultRichTextEditorStateFactory : RichTextEditorStateFactory {
|
||||||
@Composable
|
@Composable
|
||||||
override fun remember(): RichTextEditorState {
|
override fun remember(): RichTextEditorState {
|
||||||
return rememberRichTextEditorState()
|
return rememberRichTextEditorState()
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import io.element.android.libraries.textcomposer.model.SuggestionType
|
||||||
* This class is responsible for processing suggestions when `@`, `/` or `#` are type in the composer.
|
* This class is responsible for processing suggestions when `@`, `/` or `#` are type in the composer.
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
class SuggestionsProcessor() {
|
class SuggestionsProcessor {
|
||||||
/**
|
/**
|
||||||
* Process the suggestion.
|
* Process the suggestion.
|
||||||
* @param suggestion The current suggestion input
|
* @param suggestion The current suggestion input
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import kotlinx.coroutines.sync.withLock
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class TimelineItemIndexer() {
|
class TimelineItemIndexer {
|
||||||
// This is a latch to wait for the first process call
|
// This is a latch to wait for the first process call
|
||||||
private val firstProcessLatch = CompletableDeferred<Unit>()
|
private val firstProcessLatch = CompletableDeferred<Unit>()
|
||||||
private val timelineEventsIndexes = mutableMapOf<EventId, Int>()
|
private val timelineEventsIndexes = mutableMapOf<EventId, Int>()
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.features.messages.impl.timeline.model.TimelineItem
|
||||||
import io.element.android.libraries.architecture.Presenter
|
import io.element.android.libraries.architecture.Presenter
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class ReadReceiptBottomSheetPresenter() : Presenter<ReadReceiptBottomSheetState> {
|
class ReadReceiptBottomSheetPresenter : Presenter<ReadReceiptBottomSheetState> {
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): ReadReceiptBottomSheetState {
|
override fun present(): ReadReceiptBottomSheetState {
|
||||||
var selectedEvent: TimelineItem.Event? by remember { mutableStateOf(null) }
|
var selectedEvent: TimelineItem.Event? by remember { mutableStateOf(null) }
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import io.element.android.features.messages.impl.timeline.model.event.TimelineIt
|
||||||
import io.element.android.libraries.matrix.api.timeline.item.event.FailedToParseMessageLikeContent
|
import io.element.android.libraries.matrix.api.timeline.item.event.FailedToParseMessageLikeContent
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class TimelineItemContentFailedToParseMessageFactory() {
|
class TimelineItemContentFailedToParseMessageFactory {
|
||||||
fun create(@Suppress("UNUSED_PARAMETER") failedToParseMessageLike: FailedToParseMessageLikeContent): TimelineItemEventContent {
|
fun create(@Suppress("UNUSED_PARAMETER") failedToParseMessageLike: FailedToParseMessageLikeContent): TimelineItemEventContent {
|
||||||
return TimelineItemUnknownContent
|
return TimelineItemUnknownContent
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import io.element.android.features.messages.impl.timeline.model.event.TimelineIt
|
||||||
import io.element.android.libraries.matrix.api.timeline.item.event.FailedToParseStateContent
|
import io.element.android.libraries.matrix.api.timeline.item.event.FailedToParseStateContent
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class TimelineItemContentFailedToParseStateFactory() {
|
class TimelineItemContentFailedToParseStateFactory {
|
||||||
@Suppress("UNUSED_PARAMETER")
|
@Suppress("UNUSED_PARAMETER")
|
||||||
fun create(failedToParseState: FailedToParseStateContent): TimelineItemEventContent {
|
fun create(failedToParseState: FailedToParseStateContent): TimelineItemEventContent {
|
||||||
return TimelineItemUnknownContent
|
return TimelineItemUnknownContent
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import io.element.android.features.messages.impl.timeline.model.event.TimelineIt
|
||||||
import io.element.android.libraries.matrix.api.timeline.item.event.RedactedContent
|
import io.element.android.libraries.matrix.api.timeline.item.event.RedactedContent
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class TimelineItemContentRedactedFactory() {
|
class TimelineItemContentRedactedFactory {
|
||||||
fun create(@Suppress("UNUSED_PARAMETER") content: RedactedContent): TimelineItemEventContent {
|
fun create(@Suppress("UNUSED_PARAMETER") content: RedactedContent): TimelineItemEventContent {
|
||||||
return TimelineItemRedactedContent
|
return TimelineItemRedactedContent
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import io.element.android.features.messages.impl.timeline.model.event.TimelineIt
|
||||||
import io.element.android.libraries.matrix.api.timeline.item.event.UnableToDecryptContent
|
import io.element.android.libraries.matrix.api.timeline.item.event.UnableToDecryptContent
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class TimelineItemContentUTDFactory() {
|
class TimelineItemContentUTDFactory {
|
||||||
fun create(content: UnableToDecryptContent): TimelineItemEventContent {
|
fun create(content: UnableToDecryptContent): TimelineItemEventContent {
|
||||||
return TimelineItemEncryptedContent(content.data)
|
return TimelineItemEncryptedContent(content.data)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import kotlinx.collections.immutable.toImmutableList
|
||||||
|
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class TimelineItemGrouper() {
|
class TimelineItemGrouper {
|
||||||
/**
|
/**
|
||||||
* Keys are identifier of items in a group, only one by group will be kept.
|
* Keys are identifier of items in a group, only one by group will be kept.
|
||||||
* Values are the actual groupIds.
|
* Values are the actual groupIds.
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultCreatePollEntryPoint() : CreatePollEntryPoint {
|
class DefaultCreatePollEntryPoint : CreatePollEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreatePollEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): CreatePollEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultPollHistoryEntryPoint() : PollHistoryEntryPoint {
|
class DefaultPollHistoryEntryPoint : PollHistoryEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext): Node {
|
||||||
return parentNode.createNode<PollHistoryFlowNode>(buildContext)
|
return parentNode.createNode<PollHistoryFlowNode>(buildContext)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import kotlinx.coroutines.flow.MutableSharedFlow
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultCacheService() : CacheService {
|
class DefaultCacheService : CacheService {
|
||||||
private val _clearedCacheEventFlow = MutableSharedFlow<SessionId>(0)
|
private val _clearedCacheEventFlow = MutableSharedFlow<SessionId>(0)
|
||||||
override val clearedCacheEventFlow: Flow<SessionId> = _clearedCacheEventFlow
|
override val clearedCacheEventFlow: Flow<SessionId> = _clearedCacheEventFlow
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultPreferencesEntryPoint() : PreferencesEntryPoint {
|
class DefaultPreferencesEntryPoint : PreferencesEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): PreferencesEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): PreferencesEntryPoint.NodeBuilder {
|
||||||
return object : PreferencesEntryPoint.NodeBuilder {
|
return object : PreferencesEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import dev.zacsweers.metro.Inject
|
||||||
import io.element.android.libraries.architecture.Presenter
|
import io.element.android.libraries.architecture.Presenter
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class AboutPresenter() : Presenter<AboutState> {
|
class AboutPresenter : Presenter<AboutState> {
|
||||||
@Composable
|
@Composable
|
||||||
override fun present(): AboutState {
|
override fun present(): AboutState {
|
||||||
return AboutState(
|
return AboutState(
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultBugReportEntryPoint() : BugReportEntryPoint {
|
class DefaultBugReportEntryPoint : BugReportEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): BugReportEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): BugReportEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
|
|
||||||
package io.element.android.features.rageshake.impl.di
|
package io.element.android.features.rageshake.impl.di
|
||||||
|
|
||||||
import com.squareup.anvil.annotations.ContributesTo
|
import dev.zacsweers.metro.AppScope
|
||||||
|
import dev.zacsweers.metro.ContributesTo
|
||||||
import io.element.android.features.rageshake.impl.crash.PreferencesCrashDataStore
|
import io.element.android.features.rageshake.impl.crash.PreferencesCrashDataStore
|
||||||
import io.element.android.libraries.di.AppScope
|
|
||||||
|
|
||||||
@ContributesTo(AppScope::class)
|
@ContributesTo(AppScope::class)
|
||||||
interface RageshakeBindings {
|
interface RageshakeBindings {
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,6 @@ fun interface BugReportAppNameProvider {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultBugReportAppNameProvider() : BugReportAppNameProvider {
|
class DefaultBugReportAppNameProvider : BugReportAppNameProvider {
|
||||||
override fun provide(): String = RageshakeConfig.BUG_REPORT_APP_NAME
|
override fun provide(): String = RageshakeConfig.BUG_REPORT_APP_NAME
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.matrix.api.core.RoomId
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultReportRoomEntryPoint() : ReportRoomEntryPoint {
|
class DefaultReportRoomEntryPoint : ReportRoomEntryPoint {
|
||||||
override fun createNode(parentNode: Node, buildContext: BuildContext, roomId: RoomId): Node {
|
override fun createNode(parentNode: Node, buildContext: BuildContext, roomId: RoomId): Node {
|
||||||
return parentNode.createNode<ReportRoomNode>(buildContext, plugins = listOf(ReportRoomNode.Inputs(roomId)))
|
return parentNode.createNode<ReportRoomNode>(buildContext, plugins = listOf(ReportRoomNode.Inputs(roomId)))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultRoomAliasResolverEntryPoint() : RoomAliasResolverEntryPoint {
|
class DefaultRoomAliasResolverEntryPoint : RoomAliasResolverEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomAliasResolverEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomAliasResolverEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultRoomDetailsEntryPoint() : RoomDetailsEntryPoint {
|
class DefaultRoomDetailsEntryPoint : RoomDetailsEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDetailsEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDetailsEntryPoint.NodeBuilder {
|
||||||
return object : RoomDetailsEntryPoint.NodeBuilder {
|
return object : RoomDetailsEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultRoomDirectoryEntryPoint() : RoomDirectoryEntryPoint {
|
class DefaultRoomDirectoryEntryPoint : RoomDirectoryEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDirectoryEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): RoomDirectoryEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import timber.log.Timber
|
||||||
|
|
||||||
@ContributesBinding(RoomScope::class)
|
@ContributesBinding(RoomScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultRoomMemberModerationRenderer() : RoomMemberModerationRenderer {
|
class DefaultRoomMemberModerationRenderer : RoomMemberModerationRenderer {
|
||||||
@Composable
|
@Composable
|
||||||
override fun Render(
|
override fun Render(
|
||||||
state: RoomMemberModerationState,
|
state: RoomMemberModerationState,
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultSecureBackupEntryPoint() : SecureBackupEntryPoint {
|
class DefaultSecureBackupEntryPoint : SecureBackupEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): SecureBackupEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): SecureBackupEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import com.freeletics.flowredux.dsl.State as MachineState
|
import com.freeletics.flowredux.dsl.State as MachineState
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class SecureBackupSetupStateMachine() : FlowReduxStateMachine<SecureBackupSetupStateMachine.State, SecureBackupSetupStateMachine.Event>(
|
class SecureBackupSetupStateMachine : FlowReduxStateMachine<SecureBackupSetupStateMachine.State, SecureBackupSetupStateMachine.Event>(
|
||||||
initialState = State.Initial
|
initialState = State.Initial
|
||||||
) {
|
) {
|
||||||
init {
|
init {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ private const val RECOVERY_KEY_LENGTH = 48
|
||||||
private const val BASE_58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
private const val BASE_58_ALPHABET = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class RecoveryKeyTools() {
|
class RecoveryKeyTools {
|
||||||
fun isRecoveryKeyFormatValid(recoveryKey: String): Boolean {
|
fun isRecoveryKeyFormatValid(recoveryKey: String): Boolean {
|
||||||
val recoveryKeyWithoutSpace = recoveryKey.replace("\\s+".toRegex(), "")
|
val recoveryKeyWithoutSpace = recoveryKey.replace("\\s+".toRegex(), "")
|
||||||
return recoveryKeyWithoutSpace.length == RECOVERY_KEY_LENGTH && recoveryKeyWithoutSpace.all { BASE_58_ALPHABET.contains(it) }
|
return recoveryKeyWithoutSpace.length == RECOVERY_KEY_LENGTH && recoveryKeyWithoutSpace.all { BASE_58_ALPHABET.contains(it) }
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.di.SessionScope
|
||||||
|
|
||||||
@ContributesBinding(SessionScope::class)
|
@ContributesBinding(SessionScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultShareEntryPoint() : ShareEntryPoint {
|
class DefaultShareEntryPoint : ShareEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): ShareEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): ShareEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultSignedOutEntryPoint() : SignedOutEntryPoint {
|
class DefaultSignedOutEntryPoint : SignedOutEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): SignedOutEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): SignedOutEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultStartChatEntryPoint() : StartChatEntryPoint {
|
class DefaultStartChatEntryPoint : StartChatEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): StartChatEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): StartChatEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.flow.asStateFlow
|
import kotlinx.coroutines.flow.asStateFlow
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class UserListDataStore() {
|
class UserListDataStore {
|
||||||
private val _selectedUsers: MutableStateFlow<List<MatrixUser>> = MutableStateFlow(emptyList())
|
private val _selectedUsers: MutableStateFlow<List<MatrixUser>> = MutableStateFlow(emptyList())
|
||||||
|
|
||||||
fun selectUser(user: MatrixUser) {
|
fun selectUser(user: MatrixUser) {
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultUserProfileEntryPoint() : UserProfileEntryPoint {
|
class DefaultUserProfileEntryPoint : UserProfileEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): UserProfileEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): UserProfileEntryPoint.NodeBuilder {
|
||||||
return object : UserProfileEntryPoint.NodeBuilder {
|
return object : UserProfileEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultIncomingVerificationEntryPoint() : IncomingVerificationEntryPoint {
|
class DefaultIncomingVerificationEntryPoint : IncomingVerificationEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): IncomingVerificationEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): IncomingVerificationEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultOutgoingVerificationEntryPoint() : OutgoingVerificationEntryPoint {
|
class DefaultOutgoingVerificationEntryPoint : OutgoingVerificationEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): OutgoingVerificationEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): OutgoingVerificationEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,26 +25,26 @@ import io.element.android.libraries.di.SessionScope
|
||||||
class OutgoingVerificationNode(
|
class OutgoingVerificationNode(
|
||||||
@Assisted buildContext: BuildContext,
|
@Assisted buildContext: BuildContext,
|
||||||
@Assisted plugins: List<Plugin>,
|
@Assisted plugins: List<Plugin>,
|
||||||
// presenterFactory: OutgoingVerificationPresenter.Factory,
|
presenterFactory: OutgoingVerificationPresenter.Factory,
|
||||||
) : Node(buildContext, plugins = plugins) {
|
) : Node(buildContext, plugins = plugins) {
|
||||||
private val callback = plugins<OutgoingVerificationEntryPoint.Callback>().first()
|
private val callback = plugins<OutgoingVerificationEntryPoint.Callback>().first()
|
||||||
|
|
||||||
private val inputs = inputs<OutgoingVerificationEntryPoint.Params>()
|
private val inputs = inputs<OutgoingVerificationEntryPoint.Params>()
|
||||||
|
|
||||||
// private val presenter = presenterFactory.create(
|
private val presenter = presenterFactory.create(
|
||||||
// showDeviceVerifiedScreen = inputs.showDeviceVerifiedScreen,
|
showDeviceVerifiedScreen = inputs.showDeviceVerifiedScreen,
|
||||||
// verificationRequest = inputs.verificationRequest,
|
verificationRequest = inputs.verificationRequest,
|
||||||
// )
|
)
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
override fun View(modifier: Modifier) {
|
override fun View(modifier: Modifier) {
|
||||||
// val state = presenter.present()
|
val state = presenter.present()
|
||||||
// OutgoingVerificationView(
|
OutgoingVerificationView(
|
||||||
// state = state,
|
state = state,
|
||||||
// modifier = modifier,
|
modifier = modifier,
|
||||||
// onLearnMoreClick = callback::onLearnMoreAboutEncryption,
|
onLearnMoreClick = callback::onLearnMoreAboutEncryption,
|
||||||
// onFinish = callback::onDone,
|
onFinish = callback::onDone,
|
||||||
// onBack = callback::onBack,
|
onBack = callback::onBack,
|
||||||
// )
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,150 +9,172 @@
|
||||||
|
|
||||||
package io.element.android.features.verifysession.impl.outgoing
|
package io.element.android.features.verifysession.impl.outgoing
|
||||||
|
|
||||||
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
|
import androidx.compose.runtime.collectAsState
|
||||||
|
import androidx.compose.runtime.derivedStateOf
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
|
import androidx.compose.runtime.remember
|
||||||
|
import com.freeletics.flowredux.compose.rememberStateAndDispatch
|
||||||
|
import dev.zacsweers.metro.Assisted
|
||||||
|
import dev.zacsweers.metro.AssistedFactory
|
||||||
|
import dev.zacsweers.metro.Inject
|
||||||
|
import io.element.android.libraries.architecture.AsyncData
|
||||||
|
import io.element.android.libraries.architecture.Presenter
|
||||||
|
import io.element.android.libraries.matrix.api.encryption.EncryptionService
|
||||||
|
import io.element.android.libraries.matrix.api.verification.SessionVerificationService
|
||||||
|
import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus
|
||||||
|
import io.element.android.libraries.matrix.api.verification.VerificationFlowState
|
||||||
|
import io.element.android.libraries.matrix.api.verification.VerificationRequest
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
|
import kotlinx.coroutines.flow.launchIn
|
||||||
|
import kotlinx.coroutines.flow.onEach
|
||||||
|
import timber.log.Timber
|
||||||
|
import io.element.android.features.verifysession.impl.outgoing.OutgoingVerificationStateMachine.Event as StateMachineEvent
|
||||||
|
import io.element.android.features.verifysession.impl.outgoing.OutgoingVerificationStateMachine.State as StateMachineState
|
||||||
|
|
||||||
// @Inject
|
@Inject
|
||||||
// class OutgoingVerificationPresenter(
|
class OutgoingVerificationPresenter(
|
||||||
// @Assisted private val showDeviceVerifiedScreen: Boolean,
|
@Assisted private val showDeviceVerifiedScreen: Boolean,
|
||||||
// @Assisted private val verificationRequest: VerificationRequest.Outgoing,
|
@Assisted private val verificationRequest: VerificationRequest.Outgoing,
|
||||||
// private val sessionVerificationService: SessionVerificationService,
|
private val sessionVerificationService: SessionVerificationService,
|
||||||
// private val encryptionService: EncryptionService,
|
private val encryptionService: EncryptionService,
|
||||||
// ) : Presenter<OutgoingVerificationState> {
|
) : Presenter<OutgoingVerificationState> {
|
||||||
// @AssistedFactory
|
@AssistedFactory
|
||||||
// interface Factory {
|
interface Factory {
|
||||||
// fun create(
|
fun create(
|
||||||
// verificationRequest: VerificationRequest.Outgoing,
|
verificationRequest: VerificationRequest.Outgoing,
|
||||||
// showDeviceVerifiedScreen: Boolean,
|
showDeviceVerifiedScreen: Boolean,
|
||||||
// ): OutgoingVerificationPresenter
|
): OutgoingVerificationPresenter
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// private val stateMachine = OutgoingVerificationStateMachine(
|
private val stateMachine = OutgoingVerificationStateMachine(
|
||||||
// sessionVerificationService = sessionVerificationService,
|
sessionVerificationService = sessionVerificationService,
|
||||||
// encryptionService = encryptionService,
|
encryptionService = encryptionService,
|
||||||
// )
|
)
|
||||||
//
|
|
||||||
// @Composable
|
@Composable
|
||||||
// override fun present(): OutgoingVerificationState {
|
override fun present(): OutgoingVerificationState {
|
||||||
// val stateAndDispatch = stateMachine.rememberStateAndDispatch()
|
val stateAndDispatch = stateMachine.rememberStateAndDispatch()
|
||||||
//
|
|
||||||
// val sessionVerifiedStatus by sessionVerificationService.sessionVerifiedStatus.collectAsState()
|
val sessionVerifiedStatus by sessionVerificationService.sessionVerifiedStatus.collectAsState()
|
||||||
// val step by remember {
|
val step by remember {
|
||||||
// derivedStateOf {
|
derivedStateOf {
|
||||||
// when (verificationRequest) {
|
when (verificationRequest) {
|
||||||
// is VerificationRequest.Outgoing.CurrentSession -> {
|
is VerificationRequest.Outgoing.CurrentSession -> {
|
||||||
// when (sessionVerifiedStatus) {
|
when (sessionVerifiedStatus) {
|
||||||
// SessionVerifiedStatus.Unknown -> OutgoingVerificationState.Step.Loading
|
SessionVerifiedStatus.Unknown -> OutgoingVerificationState.Step.Loading
|
||||||
// SessionVerifiedStatus.NotVerified -> {
|
SessionVerifiedStatus.NotVerified -> {
|
||||||
// stateAndDispatch.state.value.toVerificationStep()
|
stateAndDispatch.state.value.toVerificationStep()
|
||||||
// }
|
}
|
||||||
// SessionVerifiedStatus.Verified -> {
|
SessionVerifiedStatus.Verified -> {
|
||||||
// if (stateAndDispatch.state.value != StateMachineState.Initial || showDeviceVerifiedScreen) {
|
if (stateAndDispatch.state.value != StateMachineState.Initial || showDeviceVerifiedScreen) {
|
||||||
// // The user has verified the session, we need to show the success screen
|
// The user has verified the session, we need to show the success screen
|
||||||
// OutgoingVerificationState.Step.Completed
|
OutgoingVerificationState.Step.Completed
|
||||||
// } else {
|
} else {
|
||||||
// // Automatic verification, which can happen on freshly created account, in this case, skip the screen
|
// Automatic verification, which can happen on freshly created account, in this case, skip the screen
|
||||||
// OutgoingVerificationState.Step.Exit
|
OutgoingVerificationState.Step.Exit
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// is VerificationRequest.Outgoing.User -> stateAndDispatch.state.value.toVerificationStep()
|
is VerificationRequest.Outgoing.User -> stateAndDispatch.state.value.toVerificationStep()
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// // Start this after observing state machine
|
// Start this after observing state machine
|
||||||
// LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
// // Force reset, just in case the service was left in a broken state
|
// Force reset, just in case the service was left in a broken state
|
||||||
// sessionVerificationService.reset(cancelAnyPendingVerificationAttempt = true)
|
sessionVerificationService.reset(cancelAnyPendingVerificationAttempt = true)
|
||||||
//
|
|
||||||
// observeVerificationService()
|
observeVerificationService()
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// fun handleEvents(event: OutgoingVerificationViewEvents) {
|
fun handleEvents(event: OutgoingVerificationViewEvents) {
|
||||||
// Timber.d("Verification user action: ${event::class.simpleName}")
|
Timber.d("Verification user action: ${event::class.simpleName}")
|
||||||
// when (event) {
|
when (event) {
|
||||||
// // Just relay the event to the state machine
|
// Just relay the event to the state machine
|
||||||
// OutgoingVerificationViewEvents.RequestVerification -> StateMachineEvent.RequestVerification(verificationRequest)
|
OutgoingVerificationViewEvents.RequestVerification -> StateMachineEvent.RequestVerification(verificationRequest)
|
||||||
// OutgoingVerificationViewEvents.StartSasVerification -> StateMachineEvent.StartSasVerification
|
OutgoingVerificationViewEvents.StartSasVerification -> StateMachineEvent.StartSasVerification
|
||||||
// OutgoingVerificationViewEvents.ConfirmVerification -> StateMachineEvent.AcceptChallenge
|
OutgoingVerificationViewEvents.ConfirmVerification -> StateMachineEvent.AcceptChallenge
|
||||||
// OutgoingVerificationViewEvents.DeclineVerification -> StateMachineEvent.DeclineChallenge
|
OutgoingVerificationViewEvents.DeclineVerification -> StateMachineEvent.DeclineChallenge
|
||||||
// OutgoingVerificationViewEvents.Cancel -> StateMachineEvent.Cancel
|
OutgoingVerificationViewEvents.Cancel -> StateMachineEvent.Cancel
|
||||||
// OutgoingVerificationViewEvents.Reset -> StateMachineEvent.Reset
|
OutgoingVerificationViewEvents.Reset -> StateMachineEvent.Reset
|
||||||
// }.let { stateMachineEvent ->
|
}.let { stateMachineEvent ->
|
||||||
// stateAndDispatch.dispatchAction(stateMachineEvent)
|
stateAndDispatch.dispatchAction(stateMachineEvent)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// return OutgoingVerificationState(
|
return OutgoingVerificationState(
|
||||||
// step = step,
|
step = step,
|
||||||
// request = verificationRequest,
|
request = verificationRequest,
|
||||||
// eventSink = ::handleEvents,
|
eventSink = ::handleEvents,
|
||||||
// )
|
)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// private fun StateMachineState?.toVerificationStep(): OutgoingVerificationState.Step =
|
private fun StateMachineState?.toVerificationStep(): OutgoingVerificationState.Step =
|
||||||
// when (val machineState = this) {
|
when (val machineState = this) {
|
||||||
// StateMachineState.Initial, null -> {
|
StateMachineState.Initial, null -> {
|
||||||
// OutgoingVerificationState.Step.Initial
|
OutgoingVerificationState.Step.Initial
|
||||||
// }
|
}
|
||||||
// is StateMachineState.RequestingVerification,
|
is StateMachineState.RequestingVerification,
|
||||||
// is StateMachineState.StartingSasVerification,
|
is StateMachineState.StartingSasVerification,
|
||||||
// StateMachineState.SasVerificationStarted -> {
|
StateMachineState.SasVerificationStarted -> {
|
||||||
// OutgoingVerificationState.Step.AwaitingOtherDeviceResponse
|
OutgoingVerificationState.Step.AwaitingOtherDeviceResponse
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// StateMachineState.VerificationRequestAccepted -> {
|
StateMachineState.VerificationRequestAccepted -> {
|
||||||
// OutgoingVerificationState.Step.Ready
|
OutgoingVerificationState.Step.Ready
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// is StateMachineState.Canceled -> {
|
is StateMachineState.Canceled -> {
|
||||||
// OutgoingVerificationState.Step.Canceled
|
OutgoingVerificationState.Step.Canceled
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// is StateMachineState.Verifying -> {
|
is StateMachineState.Verifying -> {
|
||||||
// val async = when (machineState) {
|
val async = when (machineState) {
|
||||||
// is StateMachineState.Verifying.Replying -> AsyncData.Loading()
|
is StateMachineState.Verifying.Replying -> AsyncData.Loading()
|
||||||
// else -> AsyncData.Uninitialized
|
else -> AsyncData.Uninitialized
|
||||||
// }
|
}
|
||||||
// OutgoingVerificationState.Step.Verifying(machineState.data, async)
|
OutgoingVerificationState.Step.Verifying(machineState.data, async)
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// StateMachineState.Completed -> {
|
StateMachineState.Completed -> {
|
||||||
// OutgoingVerificationState.Step.Completed
|
OutgoingVerificationState.Step.Completed
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// StateMachineState.Exit -> {
|
StateMachineState.Exit -> {
|
||||||
// OutgoingVerificationState.Step.Exit
|
OutgoingVerificationState.Step.Exit
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
//
|
|
||||||
// private fun CoroutineScope.observeVerificationService() {
|
private fun CoroutineScope.observeVerificationService() {
|
||||||
// sessionVerificationService.verificationFlowState
|
sessionVerificationService.verificationFlowState
|
||||||
// .onEach { Timber.d("Verification flow state: ${it::class.simpleName}") }
|
.onEach { Timber.d("Verification flow state: ${it::class.simpleName}") }
|
||||||
// .onEach { verificationAttemptState ->
|
.onEach { verificationAttemptState ->
|
||||||
// when (verificationAttemptState) {
|
when (verificationAttemptState) {
|
||||||
// VerificationFlowState.Initial -> stateMachine.dispatch(StateMachineEvent.Reset)
|
VerificationFlowState.Initial -> stateMachine.dispatch(StateMachineEvent.Reset)
|
||||||
// VerificationFlowState.DidAcceptVerificationRequest -> {
|
VerificationFlowState.DidAcceptVerificationRequest -> {
|
||||||
// stateMachine.dispatch(StateMachineEvent.DidAcceptVerificationRequest)
|
stateMachine.dispatch(StateMachineEvent.DidAcceptVerificationRequest)
|
||||||
// }
|
}
|
||||||
// VerificationFlowState.DidStartSasVerification -> {
|
VerificationFlowState.DidStartSasVerification -> {
|
||||||
// stateMachine.dispatch(StateMachineEvent.DidStartSasVerification)
|
stateMachine.dispatch(StateMachineEvent.DidStartSasVerification)
|
||||||
// }
|
}
|
||||||
// is VerificationFlowState.DidReceiveVerificationData -> {
|
is VerificationFlowState.DidReceiveVerificationData -> {
|
||||||
// stateMachine.dispatch(StateMachineEvent.DidReceiveChallenge(verificationAttemptState.data))
|
stateMachine.dispatch(StateMachineEvent.DidReceiveChallenge(verificationAttemptState.data))
|
||||||
// }
|
}
|
||||||
// VerificationFlowState.DidFinish -> {
|
VerificationFlowState.DidFinish -> {
|
||||||
// stateMachine.dispatch(StateMachineEvent.DidAcceptChallenge)
|
stateMachine.dispatch(StateMachineEvent.DidAcceptChallenge)
|
||||||
// }
|
}
|
||||||
// VerificationFlowState.DidCancel -> {
|
VerificationFlowState.DidCancel -> {
|
||||||
// stateMachine.dispatch(StateMachineEvent.DidCancel)
|
stateMachine.dispatch(StateMachineEvent.DidCancel)
|
||||||
// }
|
}
|
||||||
// VerificationFlowState.DidFail -> {
|
VerificationFlowState.DidFail -> {
|
||||||
// stateMachine.dispatch(StateMachineEvent.DidFail)
|
stateMachine.dispatch(StateMachineEvent.DidFail)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
// .launchIn(this)
|
.launchIn(this)
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import kotlinx.collections.immutable.ImmutableList
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultTextFileViewer() : TextFileViewer {
|
class DefaultTextFileViewer : TextFileViewer {
|
||||||
@Composable
|
@Composable
|
||||||
override fun Render(
|
override fun Render(
|
||||||
lines: ImmutableList<String>,
|
lines: ImmutableList<String>,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import io.element.android.libraries.architecture.createNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultViewFolderEntryPoint() : ViewFolderEntryPoint {
|
class DefaultViewFolderEntryPoint : ViewFolderEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): ViewFolderEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): ViewFolderEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import javax.crypto.spec.GCMParameterSpec
|
||||||
*/
|
*/
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class AESEncryptionDecryptionService() : EncryptionDecryptionService {
|
class AESEncryptionDecryptionService : EncryptionDecryptionService {
|
||||||
override fun createEncryptionCipher(key: SecretKey): Cipher {
|
override fun createEncryptionCipher(key: SecretKey): Cipher {
|
||||||
return Cipher.getInstance(AESEncryptionSpecs.CIPHER_TRANSFORMATION).apply {
|
return Cipher.getInstance(AESEncryptionSpecs.CIPHER_TRANSFORMATION).apply {
|
||||||
init(Cipher.ENCRYPT_MODE, key)
|
init(Cipher.ENCRYPT_MODE, key)
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,8 @@ import io.element.android.libraries.matrix.api.core.SessionId
|
||||||
import io.element.android.libraries.matrix.api.core.ThreadId
|
import io.element.android.libraries.matrix.api.core.ThreadId
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
class DefaultDeepLinkCreator @Inject constructor() : DeepLinkCreator {
|
@Inject
|
||||||
|
class DefaultDeepLinkCreator : DeepLinkCreator {
|
||||||
override fun create(sessionId: SessionId, roomId: RoomId?, threadId: ThreadId?): String {
|
override fun create(sessionId: SessionId, roomId: RoomId?, threadId: ThreadId?): String {
|
||||||
return buildString {
|
return buildString {
|
||||||
append("$SCHEME://$HOST/")
|
append("$SCHEME://$HOST/")
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import io.element.android.libraries.matrix.api.core.ThreadId
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultDeeplinkParser: DeeplinkParser {
|
class DefaultDeeplinkParser : DeeplinkParser {
|
||||||
override fun getFromIntent(intent: Intent): DeeplinkData? {
|
override fun getFromIntent(intent: Intent): DeeplinkData? {
|
||||||
return intent
|
return intent
|
||||||
.takeIf { it.action == Intent.ACTION_VIEW }
|
.takeIf { it.action == Intent.ACTION_VIEW }
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright 2022-2024 New Vector Ltd.
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
||||||
* Please see LICENSE files in the repository root for full details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package io.element.android.libraries.di
|
|
||||||
|
|
||||||
abstract class AppScope private constructor()
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import config.BuildTimeConfig
|
import config.BuildTimeConfig
|
||||||
import extension.buildConfigFieldStr
|
import extension.buildConfigFieldStr
|
||||||
|
import extension.setupDependencyInjection
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2022-2024 New Vector Ltd.
|
* Copyright 2022-2024 New Vector Ltd.
|
||||||
|
|
@ -14,6 +15,8 @@ plugins {
|
||||||
alias(libs.plugins.kotlin.serialization)
|
alias(libs.plugins.kotlin.serialization)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setupDependencyInjection()
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "io.element.android.libraries.matrix.api"
|
namespace = "io.element.android.libraries.matrix.api"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ package io.element.android.libraries.matrix.api.mxc
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class MxcTools() {
|
class MxcTools {
|
||||||
/**
|
/**
|
||||||
* Regex to match a Matrix Content (mxc://) URI.
|
* Regex to match a Matrix Content (mxc://) URI.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ interface ClientBuilderProvider {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RustClientBuilderProvider() : ClientBuilderProvider {
|
class RustClientBuilderProvider : ClientBuilderProvider {
|
||||||
override fun provide(): ClientBuilder {
|
override fun provide(): ClientBuilder {
|
||||||
return ClientBuilder()
|
return ClientBuilder()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import org.matrix.rustcomponents.sdk.sdkGitSha
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RustSdkMetadata() : SdkMetadata {
|
class RustSdkMetadata : SdkMetadata {
|
||||||
override val sdkGitSha: String
|
override val sdkGitSha: String
|
||||||
get() = sdkGitSha()
|
get() = sdkGitSha()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import org.matrix.rustcomponents.sdk.QrCodeData
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RustQrCodeLoginDataFactory() : MatrixQrCodeLoginDataFactory {
|
class RustQrCodeLoginDataFactory : MatrixQrCodeLoginDataFactory {
|
||||||
override fun parseQrCodeData(data: ByteArray): Result<MatrixQrCodeLoginData> {
|
override fun parseQrCodeData(data: ByteArray): Result<MatrixQrCodeLoginData> {
|
||||||
return runCatchingExceptions { SdkQrCodeLoginData(QrCodeData.fromBytes(data)) }
|
return runCatchingExceptions { SdkQrCodeLoginData(QrCodeData.fromBytes(data)) }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import java.security.KeyStoreException
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultUserCertificatesProvider() : UserCertificatesProvider {
|
class DefaultUserCertificatesProvider : UserCertificatesProvider {
|
||||||
/**
|
/**
|
||||||
* Get additional user-installed certificates from the `AndroidCAStore` `Keystore`.
|
* Get additional user-installed certificates from the `AndroidCAStore` `Keystore`.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ private const val SECRET_SIZE = 256
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultPassphraseGenerator() : PassphraseGenerator {
|
class DefaultPassphraseGenerator : PassphraseGenerator {
|
||||||
override fun generatePassphrase(): String? {
|
override fun generatePassphrase(): String? {
|
||||||
val key = ByteArray(size = SECRET_SIZE)
|
val key = ByteArray(size = SECRET_SIZE)
|
||||||
SecureRandom().nextBytes(key)
|
SecureRandom().nextBytes(key)
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import io.element.android.libraries.matrix.api.permalink.MatrixToConverter
|
||||||
*/
|
*/
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultMatrixToConverter() : MatrixToConverter {
|
class DefaultMatrixToConverter : MatrixToConverter {
|
||||||
/**
|
/**
|
||||||
* Try to convert a URL from an element web instance or from a client permalink to a matrix.to url.
|
* Try to convert a URL from an element web instance or from a client permalink to a matrix.to url.
|
||||||
* To be successfully converted, URL path should contain one of the [SUPPORTED_PATHS].
|
* To be successfully converted, URL path should contain one of the [SUPPORTED_PATHS].
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import org.matrix.rustcomponents.sdk.matrixToUserPermalink
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultPermalinkBuilder() : PermalinkBuilder {
|
class DefaultPermalinkBuilder : PermalinkBuilder {
|
||||||
override fun permalinkForUser(userId: UserId): Result<String> {
|
override fun permalinkForUser(userId: UserId): Result<String> {
|
||||||
if (!MatrixPatterns.isUserId(userId.value)) {
|
if (!MatrixPatterns.isUserId(userId.value)) {
|
||||||
return Result.failure(PermalinkBuilderError.InvalidData)
|
return Result.failure(PermalinkBuilderError.InvalidData)
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import org.matrix.rustcomponents.sdk.initPlatform
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RustInitPlatformService() : InitPlatformService {
|
class RustInitPlatformService : InitPlatformService {
|
||||||
override fun init(tracingConfiguration: TracingConfiguration) {
|
override fun init(tracingConfiguration: TracingConfiguration) {
|
||||||
initPlatform(
|
initPlatform(
|
||||||
config = tracingConfiguration.map(),
|
config = tracingConfiguration.map(),
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ interface TimelineEventTypeFilterFactory {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RustTimelineEventTypeFilterFactory() : TimelineEventTypeFilterFactory {
|
class RustTimelineEventTypeFilterFactory : TimelineEventTypeFilterFactory {
|
||||||
override fun create(listStateEventType: List<StateEventType>): TimelineEventTypeFilter {
|
override fun create(listStateEventType: List<StateEventType>): TimelineEventTypeFilter {
|
||||||
return TimelineEventTypeFilter.exclude(
|
return TimelineEventTypeFilter.exclude(
|
||||||
listStateEventType.map { stateEventType ->
|
listStateEventType.map { stateEventType ->
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import io.element.android.libraries.matrix.api.room.alias.RoomAliasHelper
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultRoomAliasHelper() : RoomAliasHelper {
|
class DefaultRoomAliasHelper : RoomAliasHelper {
|
||||||
override fun roomAliasNameFromRoomDisplayName(name: String): String {
|
override fun roomAliasNameFromRoomDisplayName(name: String): String {
|
||||||
return org.matrix.rustcomponents.sdk.roomAliasNameFromRoomDisplayName(name)
|
return org.matrix.rustcomponents.sdk.roomAliasNameFromRoomDisplayName(name)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import kotlinx.coroutines.flow.runningFold
|
||||||
|
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RoomMemberProfilesCache() {
|
class RoomMemberProfilesCache {
|
||||||
private val cache = MutableStateFlow(mapOf<UserId, RoomMember>())
|
private val cache = MutableStateFlow(mapOf<UserId, RoomMember>())
|
||||||
val updateFlow = cache.drop(1).runningFold(0) { acc, _ -> acc + 1 }
|
val updateFlow = cache.drop(1).runningFold(0) { acc, _ -> acc + 1 }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ import kotlinx.coroutines.flow.runningFold
|
||||||
|
|
||||||
@SingleIn(RoomScope::class)
|
@SingleIn(RoomScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class RoomNamesCache() {
|
class RoomNamesCache {
|
||||||
private val cache = MutableStateFlow(mapOf<RoomIdOrAlias, String?>())
|
private val cache = MutableStateFlow(mapOf<RoomIdOrAlias, String?>())
|
||||||
val updateFlow = cache.drop(1).runningFold(0) { acc, _ -> acc + 1 }
|
val updateFlow = cache.drop(1).runningFold(0) { acc, _ -> acc + 1 }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import io.element.android.libraries.mediaviewer.impl.gallery.root.MediaGalleryRo
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultMediaGalleryEntryPoint() : MediaGalleryEntryPoint {
|
class DefaultMediaGalleryEntryPoint : MediaGalleryEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): MediaGalleryEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): MediaGalleryEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ import io.element.android.libraries.mediaviewer.impl.viewer.MediaViewerNode
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultMediaViewerEntryPoint() : MediaViewerEntryPoint {
|
class DefaultMediaViewerEntryPoint : MediaViewerEntryPoint {
|
||||||
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): MediaViewerEntryPoint.NodeBuilder {
|
override fun nodeBuilder(parentNode: Node, buildContext: BuildContext): MediaViewerEntryPoint.NodeBuilder {
|
||||||
val plugins = ArrayList<Plugin>()
|
val plugins = ArrayList<Plugin>()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import io.element.android.libraries.mediaviewer.impl.model.MediaItem
|
||||||
import kotlinx.collections.immutable.toImmutableList
|
import kotlinx.collections.immutable.toImmutableList
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
class MediaItemsPostProcessor() {
|
class MediaItemsPostProcessor {
|
||||||
fun process(
|
fun process(
|
||||||
mediaItems: List<MediaItem>,
|
mediaItems: List<MediaItem>,
|
||||||
): GroupedMediaItems {
|
): GroupedMediaItems {
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ import io.element.android.libraries.mediaviewer.api.util.FileExtensionExtractor
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class FileExtensionExtractorWithValidation() : FileExtensionExtractor {
|
class FileExtensionExtractorWithValidation : FileExtensionExtractor {
|
||||||
override fun extractFromName(name: String): String {
|
override fun extractFromName(name: String): String {
|
||||||
val fileExtension = name.substringAfterLast('.', "")
|
val fileExtension = name.substringAfterLast('.', "")
|
||||||
// Makes sure the extension is known by the system, otherwise default to binary extension.
|
// Makes sure the extension is known by the system, otherwise default to binary extension.
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ import io.element.android.libraries.mediaviewer.impl.model.eventId
|
||||||
* (keyOffset = -1)
|
* (keyOffset = -1)
|
||||||
*/
|
*/
|
||||||
@Inject
|
@Inject
|
||||||
class PagerKeysHandler() {
|
class PagerKeysHandler {
|
||||||
private data class Data(
|
private data class Data(
|
||||||
val mediaItems: List<MediaItem>,
|
val mediaItems: List<MediaItem>,
|
||||||
val keyOffset: Long,
|
val keyOffset: Long,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@SingleIn(AppScope::class)
|
@SingleIn(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class DefaultOidcActionFlow() : OidcActionFlow {
|
class DefaultOidcActionFlow : OidcActionFlow {
|
||||||
private val mutableStateFlow = MutableStateFlow<OidcAction?>(null)
|
private val mutableStateFlow = MutableStateFlow<OidcAction?>(null)
|
||||||
|
|
||||||
override fun post(oidcAction: OidcAction) {
|
override fun post(oidcAction: OidcAction) {
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ interface ComposablePermissionStateProvider {
|
||||||
|
|
||||||
@ContributesBinding(AppScope::class)
|
@ContributesBinding(AppScope::class)
|
||||||
@Inject
|
@Inject
|
||||||
class AccompanistPermissionStateProvider() : ComposablePermissionStateProvider {
|
class AccompanistPermissionStateProvider : ComposablePermissionStateProvider {
|
||||||
@Composable
|
@Composable
|
||||||
override fun provide(permission: String, onPermissionResult: (Boolean) -> Unit): PermissionState {
|
override fun provide(permission: String, onPermissionResult: (Boolean) -> Unit): PermissionState {
|
||||||
return rememberPermissionState(
|
return rememberPermissionState(
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ import dev.zacsweers.metro.ContributesBinding
|
||||||
import dev.zacsweers.metro.Inject
|
import dev.zacsweers.metro.Inject
|
||||||
import dev.zacsweers.metro.SingleIn
|
import dev.zacsweers.metro.SingleIn
|
||||||
import io.element.android.libraries.androidutils.preferences.DefaultPreferencesCorruptionHandlerFactory
|
import io.element.android.libraries.androidutils.preferences.DefaultPreferencesCorruptionHandlerFactory
|
||||||
import io.element.android.libraries.di.ApplicationContext
|
import io.element.android.libraries.di.annotations.ApplicationContext
|
||||||
import io.element.android.libraries.preferences.api.store.PreferenceDataStoreFactory
|
import io.element.android.libraries.preferences.api.store.PreferenceDataStoreFactory
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue