File tree Expand file tree Collapse file tree 6 files changed +41
-1
lines changed
matrix-sdk-android/src/main/java/org/matrix/android/sdk Expand file tree Collapse file tree 6 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ data class HomeServerCapabilities(
85
85
* External account management url for use with MSC3824 delegated OIDC, provided in Wellknown.
86
86
*/
87
87
val externalAccountManagementUrl : String? = null ,
88
+
89
+ /* *
90
+ * Authentication issuer for use with MSC3824 delegated OIDC, provided in Wellknown.
91
+ */
92
+ val authenticationIssuer : String? = null ,
88
93
) {
89
94
90
95
enum class RoomCapabilitySupport {
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo049
69
69
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo050
70
70
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo051
71
71
import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo052
72
+ import org.matrix.android.sdk.internal.database.migration.MigrateSessionTo053
72
73
import org.matrix.android.sdk.internal.util.Normalizer
73
74
import org.matrix.android.sdk.internal.util.database.MatrixRealmMigration
74
75
import javax.inject.Inject
@@ -77,7 +78,7 @@ internal class RealmSessionStoreMigration @Inject constructor(
77
78
private val normalizer : Normalizer
78
79
) : MatrixRealmMigration(
79
80
dbName = " Session" ,
80
- schemaVersion = 52L ,
81
+ schemaVersion = 53L ,
81
82
) {
82
83
/* *
83
84
* Forces all RealmSessionStoreMigration instances to be equal.
@@ -139,5 +140,6 @@ internal class RealmSessionStoreMigration @Inject constructor(
139
140
if (oldVersion < 50 ) MigrateSessionTo050 (realm).perform()
140
141
if (oldVersion < 51 ) MigrateSessionTo051 (realm).perform()
141
142
if (oldVersion < 52 ) MigrateSessionTo052 (realm).perform()
143
+ if (oldVersion < 53 ) MigrateSessionTo053 (realm).perform()
142
144
}
143
145
}
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ internal object HomeServerCapabilitiesMapper {
49
49
canRemotelyTogglePushNotificationsOfDevices = entity.canRemotelyTogglePushNotificationsOfDevices,
50
50
canRedactRelatedEvents = entity.canRedactEventWithRelations,
51
51
externalAccountManagementUrl = entity.externalAccountManagementUrl,
52
+ authenticationIssuer = entity.authenticationIssuer,
52
53
)
53
54
}
54
55
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2023 The Matrix.org Foundation C.I.C.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ package org.matrix.android.sdk.internal.database.migration
18
+
19
+ import io.realm.DynamicRealm
20
+ import org.matrix.android.sdk.internal.database.model.HomeServerCapabilitiesEntityFields
21
+ import org.matrix.android.sdk.internal.extensions.forceRefreshOfHomeServerCapabilities
22
+ import org.matrix.android.sdk.internal.util.database.RealmMigrator
23
+
24
+ internal class MigrateSessionTo053 (realm : DynamicRealm ) : RealmMigrator(realm, 53 ) {
25
+ override fun doMigrate (realm : DynamicRealm ) {
26
+ realm.schema.get(" HomeServerCapabilitiesEntity" )
27
+ ?.addField(HomeServerCapabilitiesEntityFields .AUTHENTICATION_ISSUER , String ::class .java)
28
+ ?.forceRefreshOfHomeServerCapabilities()
29
+ }
30
+ }
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ internal open class HomeServerCapabilitiesEntity(
36
36
var canRemotelyTogglePushNotificationsOfDevices : Boolean = false ,
37
37
var canRedactEventWithRelations : Boolean = false ,
38
38
var externalAccountManagementUrl : String? = null ,
39
+ var authenticationIssuer : String? = null ,
39
40
) : RealmObject() {
40
41
41
42
companion object
Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ internal class DefaultGetHomeServerCapabilitiesTask @Inject constructor(
165
165
Timber .v(" Extracted integration config : $config " )
166
166
realm.insertOrUpdate(config)
167
167
}
168
+ homeServerCapabilitiesEntity.authenticationIssuer = getWellknownResult.wellKnown.unstableDelegatedAuthConfig?.issuer
168
169
homeServerCapabilitiesEntity.externalAccountManagementUrl = getWellknownResult.wellKnown.unstableDelegatedAuthConfig?.accountManagementUrl
169
170
}
170
171
You can’t perform that action at this time.
0 commit comments