Move getAdditionalCertificates function to a dedicated class (no change in the implementation).

This commit is contained in:
Benoit Marty 2024-02-22 11:02:26 +01:00
parent 1751920d42
commit fd555b1070
6 changed files with 130 additions and 57 deletions

View file

@ -42,6 +42,7 @@ class MainActivity : ComponentActivity() {
val baseDirectory = File(applicationContext.filesDir, "sessions")
val userAgentProvider = SimpleUserAgentProvider("MinimalSample")
val sessionStore = InMemorySessionStore()
val userCertificatesProvider = NoOpUserCertificatesProvider()
RustMatrixAuthenticationService(
baseDirectory = baseDirectory,
coroutineDispatchers = Singleton.coroutineDispatchers,
@ -54,10 +55,12 @@ class MainActivity : ComponentActivity() {
coroutineDispatchers = Singleton.coroutineDispatchers,
sessionStore = sessionStore,
userAgentProvider = userAgentProvider,
userCertificatesProvider = userCertificatesProvider,
clock = DefaultSystemClock(),
),
passphraseGenerator = NullPassphraseGenerator(),
buildMeta = Singleton.buildMeta,
userCertificatesProvider = userCertificatesProvider,
)
}

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2024 New Vector Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package io.element.android.samples.minimal
import io.element.android.libraries.matrix.impl.certificates.UserCertificatesProvider
class NoOpUserCertificatesProvider : UserCertificatesProvider {
override fun provides(): List<ByteArray> = emptyList()
}