Merge branch 'develop' into feature/fga/csam_preferences_server

This commit is contained in:
ganfra 2025-06-30 21:42:06 +02:00
commit 773fa1657a
623 changed files with 4661 additions and 2049 deletions

View file

@ -50,11 +50,11 @@ import io.element.android.features.createroom.api.CreateRoomEntryPoint
import io.element.android.features.ftue.api.FtueEntryPoint
import io.element.android.features.ftue.api.state.FtueService
import io.element.android.features.ftue.api.state.FtueState
import io.element.android.features.home.api.HomeEntryPoint
import io.element.android.features.logout.api.LogoutEntryPoint
import io.element.android.features.preferences.api.PreferencesEntryPoint
import io.element.android.features.roomdirectory.api.RoomDescription
import io.element.android.features.roomdirectory.api.RoomDirectoryEntryPoint
import io.element.android.features.roomlist.api.RoomListEntryPoint
import io.element.android.features.securebackup.api.SecureBackupEntryPoint
import io.element.android.features.share.api.ShareEntryPoint
import io.element.android.features.userprofile.api.UserProfileEntryPoint
@ -91,6 +91,15 @@ import java.time.Duration
import java.time.Instant
import java.util.Optional
import java.util.UUID
import kotlin.collections.List
import kotlin.collections.any
import kotlin.collections.emptyList
import kotlin.collections.first
import kotlin.collections.forEach
import kotlin.collections.listOf
import kotlin.collections.mapNotNull
import kotlin.collections.plus
import kotlin.collections.setOf
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds
import kotlin.time.toKotlinDuration
@ -99,7 +108,7 @@ import kotlin.time.toKotlinDuration
class LoggedInFlowNode @AssistedInject constructor(
@Assisted buildContext: BuildContext,
@Assisted plugins: List<Plugin>,
private val roomListEntryPoint: RoomListEntryPoint,
private val homeEntryPoint: HomeEntryPoint,
private val preferencesEntryPoint: PreferencesEntryPoint,
private val createRoomEntryPoint: CreateRoomEntryPoint,
private val appNavigationStateService: AppNavigationStateService,
@ -162,7 +171,7 @@ class LoggedInFlowNode @AssistedInject constructor(
// Otherwise, the RoomList UI may be incorrectly displayed on top
withTimeout(5.seconds) {
backstack.elements.first { elements ->
elements.any { it.key.navTarget == NavTarget.RoomList }
elements.any { it.key.navTarget == NavTarget.Home }
}
}
@ -188,7 +197,7 @@ class LoggedInFlowNode @AssistedInject constructor(
when (ftueState) {
is FtueState.Unknown -> Unit // Nothing to do
is FtueState.Incomplete -> backstack.safeRoot(NavTarget.Ftue)
is FtueState.Complete -> backstack.safeRoot(NavTarget.RoomList)
is FtueState.Complete -> backstack.safeRoot(NavTarget.Home)
}
}
.launchIn(lifecycleScope)
@ -215,7 +224,7 @@ class LoggedInFlowNode @AssistedInject constructor(
data object LoggedInPermanent : NavTarget
@Parcelize
data object RoomList : NavTarget
data object Home : NavTarget
@Parcelize
data class Room(
@ -272,8 +281,8 @@ class LoggedInFlowNode @AssistedInject constructor(
}
createNode<LoggedInNode>(buildContext, listOf(callback))
}
NavTarget.RoomList -> {
val callback = object : RoomListEntryPoint.Callback {
NavTarget.Home -> {
val callback = object : HomeEntryPoint.Callback {
override fun onRoomClick(roomId: RoomId) {
backstack.push(NavTarget.Room(roomId.toRoomIdOrAlias()))
}
@ -306,7 +315,7 @@ class LoggedInFlowNode @AssistedInject constructor(
backstack.push(NavTarget.LogoutForNativeSlidingSyncMigrationNeeded)
}
}
roomListEntryPoint
homeEntryPoint
.nodeBuilder(this, buildContext)
.callback(callback)
.build()
@ -490,7 +499,7 @@ class LoggedInFlowNode @AssistedInject constructor(
clearBackstack: Boolean,
) {
waitForNavTargetAttached { navTarget ->
navTarget is NavTarget.RoomList
navTarget is NavTarget.Home
}
attachChild<RoomFlowNode> {
val roomNavTarget = NavTarget.Room(
@ -507,7 +516,7 @@ class LoggedInFlowNode @AssistedInject constructor(
suspend fun attachUser(userId: UserId) {
waitForNavTargetAttached { navTarget ->
navTarget is NavTarget.RoomList
navTarget is NavTarget.Home
}
attachChild<Node> {
backstack.push(
@ -520,7 +529,7 @@ class LoggedInFlowNode @AssistedInject constructor(
internal suspend fun attachIncomingShare(intent: Intent) {
waitForNavTargetAttached { navTarget ->
navTarget is NavTarget.RoomList
navTarget is NavTarget.Home
}
attachChild<Node> {
backstack.push(
@ -558,7 +567,7 @@ private class AttachRoomOperation(
return if (clearBackstack) {
// Makes sure the room list target is alone in the backstack and stashed
elements.mapNotNull { element ->
if (element.key.navTarget == LoggedInFlowNode.NavTarget.RoomList) {
if (element.key.navTarget == LoggedInFlowNode.NavTarget.Home) {
element.transitionTo(STASHED, this)
} else {
null

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
<string name="banner_migrate_to_native_sliding_sync_action">"Log ud og opgradér"</string>
<string name="banner_migrate_to_native_sliding_sync_app_force_logout_title">"%1$s understøtter ikke længere den gamle protokol. Log ud og log ind igen for at fortsætte med at bruge appen."</string>
<string name="banner_migrate_to_native_sliding_sync_force_logout_title">"Din hjemmeserver understøtter ikke længere den gamle protokol. Log ud og log ind igen for at fortsætte med at bruge appen."</string>
</resources>