Skip to content

Commit abc5547

Browse files
committed
Merge branch 'develop' into feature/fga/user_moderation_bottomsheet
2 parents 5625e28 + 07c007e commit abc5547

File tree

647 files changed

+7232
-2897
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

647 files changed

+7232
-2897
lines changed

app/build.gradle.kts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,12 @@ fun Project.configureLicensesTasks(reportingExtension: ReportingExtension) {
354354
}
355355
}
356356
}
357+
358+
configurations.all {
359+
resolutionStrategy {
360+
dependencySubstitution {
361+
val tink = libs.google.tink.get()
362+
substitute(module("com.google.crypto.tink:tink")).using(module("${tink.group}:${tink.name}:${tink.version}"))
363+
}
364+
}
365+
}

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
</intent-filter>
9292
<!--
9393
Element mobile links
94-
Example: https://mobile.element.io/element?account_provider=example.org&login_hint=mxid:@alice:example.org
94+
Example: https://mobile.element.io/element/?account_provider=example.org&login_hint=mxid:@alice:example.org
9595
-->
9696
<intent-filter android:autoVerify="true">
9797
<action android:name="android.intent.action.VIEW" />
@@ -102,7 +102,7 @@
102102
<data android:scheme="https" />
103103
<!-- Matching asset file: https://mobile.element.io/.well-known/assetlinks.json -->
104104
<data android:host="mobile.element.io" />
105-
<data android:path="/element" />
105+
<data android:path="/element/" />
106106
</intent-filter>
107107
<!--
108108
matrix.to links

app/src/main/res/xml/backup_rules.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,8 @@
99
-->
1010
<full-backup-content>
1111
<exclude domain="root" path="." />
12+
<exclude domain="file" path="." />
13+
<exclude domain="database" path="." />
14+
<exclude domain="sharedpref" path="." />
15+
<exclude domain="external" path="."/>
1216
</full-backup-content>

app/src/main/res/xml/data_extraction_rules.xml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@
99
-->
1010
<data-extraction-rules>
1111
<cloud-backup>
12-
<exclude domain="root" path="." />
12+
<exclude domain="root" path="."/>
13+
<exclude domain="file" path="."/>
14+
<exclude domain="database" path="."/>
15+
<exclude domain="sharedpref" path="."/>
16+
<exclude domain="external" path="."/>
1317
</cloud-backup>
18+
1419
<device-transfer>
15-
<exclude domain="root" path="." />
20+
<exclude domain="root" path="."/>
21+
<exclude domain="file" path="."/>
22+
<exclude domain="database" path="."/>
23+
<exclude domain="sharedpref" path="."/>
24+
<exclude domain="external" path="."/>
1625
</device-transfer>
17-
</data-extraction-rules>
26+
</data-extraction-rules>

app/src/main/res/xml/locales_config.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<locale android:name="sv"/>
3131
<locale android:name="tr"/>
3232
<locale android:name="uk"/>
33+
<locale android:name="ur"/>
3334
<locale android:name="uz"/>
3435
<locale android:name="zh-CN"/>
3536
<locale android:name="zh-TW"/>

appnav/build.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,13 @@ dependencies {
5555
testImplementation(libs.test.turbine)
5656
testImplementation(projects.features.login.test)
5757
testImplementation(projects.libraries.matrix.test)
58-
testImplementation(projects.libraries.oidc.impl)
58+
testImplementation(projects.libraries.oidc.test)
5959
testImplementation(projects.libraries.preferences.test)
6060
testImplementation(projects.libraries.push.test)
6161
testImplementation(projects.libraries.pushproviders.test)
6262
testImplementation(projects.features.networkmonitor.test)
63-
testImplementation(projects.features.login.impl)
6463
testImplementation(projects.tests.testutils)
6564
testImplementation(projects.features.rageshake.test)
66-
testImplementation(projects.features.rageshake.impl)
6765
testImplementation(projects.features.share.test)
6866
testImplementation(projects.services.appnavstate.test)
6967
testImplementation(projects.services.analytics.test)

appnav/src/main/kotlin/io/element/android/appnav/room/joined/JoinedRoomLoadedFlowNode.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import io.element.android.libraries.matrix.api.core.RoomId
3636
import io.element.android.libraries.matrix.api.core.UserId
3737
import io.element.android.libraries.matrix.api.permalink.PermalinkData
3838
import io.element.android.libraries.matrix.api.room.JoinedRoom
39+
import io.element.android.services.appnavstate.api.ActiveRoomsHolder
3940
import io.element.android.services.appnavstate.api.AppNavigationStateService
4041
import kotlinx.coroutines.CoroutineScope
4142
import kotlinx.coroutines.launch
@@ -51,6 +52,7 @@ class JoinedRoomLoadedFlowNode @AssistedInject constructor(
5152
private val appNavigationStateService: AppNavigationStateService,
5253
private val appCoroutineScope: CoroutineScope,
5354
private val matrixClient: MatrixClient,
55+
private val activeRoomsHolder: ActiveRoomsHolder,
5456
roomComponentFactory: RoomComponentFactory,
5557
) : BaseFlowNode<JoinedRoomLoadedFlowNode.NavTarget>(
5658
backstack = BackStack(
@@ -85,6 +87,7 @@ class JoinedRoomLoadedFlowNode @AssistedInject constructor(
8587
onCreate = {
8688
Timber.v("OnCreate => ${inputs.room.roomId}")
8789
appNavigationStateService.onNavigateToRoom(id, inputs.room.roomId)
90+
activeRoomsHolder.addRoom(inputs.room)
8891
fetchRoomMembers()
8992
trackVisitedRoom()
9093
},
@@ -95,6 +98,7 @@ class JoinedRoomLoadedFlowNode @AssistedInject constructor(
9598
},
9699
onDestroy = {
97100
Timber.v("OnDestroy")
101+
activeRoomsHolder.removeRoom(inputs.room.sessionId, inputs.room.roomId)
98102
inputs.room.destroy()
99103
appNavigationStateService.onLeavingRoom(id)
100104
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
33
<string name="banner_migrate_to_native_sliding_sync_action">"Amaitu saioa eta bertsio-berritu"</string>
4+
<string name="banner_migrate_to_native_sliding_sync_app_force_logout_title">"%1$s(e)k ez da bateragarria lehengo protokoloarekin. Amaitu saioa eta hasi berriro aplikazioa erabiltzen jarraitzeko."</string>
45
<string name="banner_migrate_to_native_sliding_sync_force_logout_title">"Zure zerbitzaria ez da bateragarria protokolo zaharrarekin. Amaitu saioa eta hasi berriro aplikazioa erabiltzen jarraitzeko."</string>
56
</resources>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
3+
<string name="banner_migrate_to_native_sliding_sync_action">"Sair e atualizar"</string>
4+
<string name="banner_migrate_to_native_sliding_sync_app_force_logout_title">"%1$s não suporta mais o protocolo antigo. Termine sessão e volte a iniciar sessão para continuar a utilizar a aplicação."</string>
5+
<string name="banner_migrate_to_native_sliding_sync_force_logout_title">"Seu servidor doméstico não é mais compatível com o protocolo antigo. Faça logout e login novamente para continuar usando o aplicativo."</string>
6+
</resources>

appnav/src/test/kotlin/io/element/android/appnav/JoinBaseRoomLoadedFlowNodeTest.kt renamed to appnav/src/test/kotlin/io/element/android/appnav/JoinedRoomLoadedFlowNodeTest.kt

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,18 @@ import io.element.android.features.messages.api.MessagesEntryPoint
2424
import io.element.android.features.roomdetails.api.RoomDetailsEntryPoint
2525
import io.element.android.libraries.architecture.childNode
2626
import io.element.android.libraries.matrix.api.room.JoinedRoom
27+
import io.element.android.libraries.matrix.test.A_SESSION_ID
2728
import io.element.android.libraries.matrix.test.FakeMatrixClient
2829
import io.element.android.libraries.matrix.test.room.FakeBaseRoom
2930
import io.element.android.libraries.matrix.test.room.FakeJoinedRoom
31+
import io.element.android.services.appnavstate.api.ActiveRoomsHolder
3032
import io.element.android.services.appnavstate.test.FakeAppNavigationStateService
31-
import kotlinx.coroutines.CoroutineScope
33+
import kotlinx.coroutines.test.TestScope
3234
import kotlinx.coroutines.test.runTest
3335
import org.junit.Rule
3436
import org.junit.Test
3537

36-
class JoinBaseRoomLoadedFlowNodeTest {
38+
class JoinedRoomLoadedFlowNodeTest {
3739
@get:Rule
3840
val instantTaskExecutorRule = InstantTaskExecutorRule()
3941

@@ -96,20 +98,21 @@ class JoinBaseRoomLoadedFlowNodeTest {
9698
}
9799
}
98100

99-
private fun createJoinedRoomLoadedFlowNode(
101+
private fun TestScope.createJoinedRoomLoadedFlowNode(
100102
plugins: List<Plugin>,
101103
messagesEntryPoint: MessagesEntryPoint = FakeMessagesEntryPoint(),
102104
roomDetailsEntryPoint: RoomDetailsEntryPoint = FakeRoomDetailsEntryPoint(),
103-
coroutineScope: CoroutineScope,
105+
activeRoomsHolder: ActiveRoomsHolder = ActiveRoomsHolder(),
104106
) = JoinedRoomLoadedFlowNode(
105107
buildContext = BuildContext.root(savedStateMap = null),
106108
plugins = plugins,
107109
messagesEntryPoint = messagesEntryPoint,
108110
roomDetailsEntryPoint = roomDetailsEntryPoint,
109111
appNavigationStateService = FakeAppNavigationStateService(),
110-
appCoroutineScope = coroutineScope,
112+
appCoroutineScope = this,
111113
roomComponentFactory = FakeRoomComponentFactory(),
112114
matrixClient = FakeMatrixClient(),
115+
activeRoomsHolder = activeRoomsHolder,
113116
)
114117

115118
@Test
@@ -121,7 +124,6 @@ class JoinBaseRoomLoadedFlowNodeTest {
121124
val roomFlowNode = createJoinedRoomLoadedFlowNode(
122125
plugins = listOf(inputs),
123126
messagesEntryPoint = fakeMessagesEntryPoint,
124-
coroutineScope = this
125127
)
126128
// WHEN
127129
val roomFlowNodeTestHelper = roomFlowNode.parentNodeTestHelper()
@@ -144,7 +146,6 @@ class JoinBaseRoomLoadedFlowNodeTest {
144146
plugins = listOf(inputs),
145147
messagesEntryPoint = fakeMessagesEntryPoint,
146148
roomDetailsEntryPoint = fakeRoomDetailsEntryPoint,
147-
coroutineScope = this
148149
)
149150
val roomFlowNodeTestHelper = roomFlowNode.parentNodeTestHelper()
150151
// WHEN
@@ -154,4 +155,53 @@ class JoinBaseRoomLoadedFlowNodeTest {
154155
val roomDetailsNode = roomFlowNode.childNode(JoinedRoomLoadedFlowNode.NavTarget.RoomDetails)!!
155156
assertThat(roomDetailsNode.id).isEqualTo(fakeRoomDetailsEntryPoint.nodeId)
156157
}
158+
159+
@Test
160+
fun `the ActiveRoomsHolder will be updated with the loaded room on create`() = runTest {
161+
// GIVEN
162+
val room = FakeJoinedRoom(baseRoom = FakeBaseRoom(updateMembersResult = {}))
163+
val fakeMessagesEntryPoint = FakeMessagesEntryPoint()
164+
val fakeRoomDetailsEntryPoint = FakeRoomDetailsEntryPoint()
165+
val inputs = JoinedRoomLoadedFlowNode.Inputs(room, RoomNavigationTarget.Messages())
166+
val activeRoomsHolder = ActiveRoomsHolder()
167+
val roomFlowNode = createJoinedRoomLoadedFlowNode(
168+
plugins = listOf(inputs),
169+
messagesEntryPoint = fakeMessagesEntryPoint,
170+
roomDetailsEntryPoint = fakeRoomDetailsEntryPoint,
171+
activeRoomsHolder = activeRoomsHolder,
172+
)
173+
174+
assertThat(activeRoomsHolder.getActiveRoom(A_SESSION_ID)).isNull()
175+
val roomFlowNodeTestHelper = roomFlowNode.parentNodeTestHelper()
176+
// WHEN
177+
roomFlowNodeTestHelper.assertChildHasLifecycle(JoinedRoomLoadedFlowNode.NavTarget.Messages(null), Lifecycle.State.CREATED)
178+
// THEN
179+
assertThat(activeRoomsHolder.getActiveRoom(A_SESSION_ID)).isNotNull()
180+
}
181+
182+
@Test
183+
fun `the ActiveRoomsHolder will be removed on destroy`() = runTest {
184+
// GIVEN
185+
val room = FakeJoinedRoom(baseRoom = FakeBaseRoom(updateMembersResult = {}))
186+
val fakeMessagesEntryPoint = FakeMessagesEntryPoint()
187+
val fakeRoomDetailsEntryPoint = FakeRoomDetailsEntryPoint()
188+
val inputs = JoinedRoomLoadedFlowNode.Inputs(room, RoomNavigationTarget.Messages())
189+
val activeRoomsHolder = ActiveRoomsHolder().apply {
190+
addRoom(room)
191+
}
192+
val roomFlowNode = createJoinedRoomLoadedFlowNode(
193+
plugins = listOf(inputs),
194+
messagesEntryPoint = fakeMessagesEntryPoint,
195+
roomDetailsEntryPoint = fakeRoomDetailsEntryPoint,
196+
activeRoomsHolder = activeRoomsHolder,
197+
)
198+
val roomFlowNodeTestHelper = roomFlowNode.parentNodeTestHelper()
199+
roomFlowNodeTestHelper.assertChildHasLifecycle(JoinedRoomLoadedFlowNode.NavTarget.Messages(null), Lifecycle.State.CREATED)
200+
assertThat(activeRoomsHolder.getActiveRoom(A_SESSION_ID)).isNotNull()
201+
// WHEN
202+
roomFlowNode.updateLifecycleState(Lifecycle.State.DESTROYED)
203+
// THEN
204+
roomFlowNodeTestHelper.assertChildHasLifecycle(JoinedRoomLoadedFlowNode.NavTarget.Messages(null), Lifecycle.State.DESTROYED)
205+
assertThat(activeRoomsHolder.getActiveRoom(A_SESSION_ID)).isNull()
206+
}
157207
}

0 commit comments

Comments
 (0)