mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Use the ClientFactory pattern everywhere replacing raw ClientBuilders.
# Conflicts: # ElementX/Sources/Services/UserSession/UserSessionStore.swift # NSE/Sources/NSEUserSession.swift
This commit is contained in:
@@ -53,8 +53,8 @@ final nonisolated class AppHooks: AppHooksProtocol {
|
||||
@AppHook(default: DefaultTracingHook())
|
||||
var tracingHook: TracingHookProtocol
|
||||
|
||||
@AppHook(default: DefaultClientBuilderHook())
|
||||
var clientBuilderHook: ClientBuilderHookProtocol
|
||||
@AppHook(default: DefaultClientFactoryHook())
|
||||
var clientFactoryHook: ClientFactoryHookProtocol
|
||||
|
||||
@AppHook(default: DefaultRemoteSettingsHook())
|
||||
var remoteSettingsHook: RemoteSettingsHookProtocol
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
//
|
||||
// Copyright 2025 Element Creations Ltd.
|
||||
// Copyright 2024-2025 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.
|
||||
//
|
||||
|
||||
import MatrixRustSDK
|
||||
|
||||
nonisolated protocol ClientBuilderHookProtocol: Sendable {
|
||||
func configure(_ builder: ClientBuilder) -> ClientBuilder
|
||||
}
|
||||
|
||||
nonisolated struct DefaultClientBuilderHook: ClientBuilderHookProtocol {
|
||||
func configure(_ builder: ClientBuilder) -> ClientBuilder {
|
||||
builder
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Copyright 2025 Element Creations Ltd.
|
||||
// Copyright 2024-2025 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.
|
||||
//
|
||||
|
||||
import MatrixRustSDK
|
||||
|
||||
nonisolated protocol ClientFactoryHookProtocol: Sendable {
|
||||
func configure(_ builder: ClientBuilder, toRestore session: Session?) -> ClientBuilder
|
||||
|
||||
func updateAuthenticationClient(_ client: ClientProtocol) -> ClientProtocol
|
||||
}
|
||||
|
||||
nonisolated struct DefaultClientFactoryHook: ClientFactoryHookProtocol {
|
||||
func configure(_ builder: ClientBuilder, toRestore session: Session?) -> ClientBuilder {
|
||||
builder
|
||||
}
|
||||
|
||||
func updateAuthenticationClient(_ client: ClientProtocol) -> ClientProtocol {
|
||||
client
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user