Add a ClientBuilder hook. (#3056)

This commit is contained in:
Doug
2024-07-18 09:47:37 +01:00
committed by GitHub
parent 536d6a1567
commit de07f441f0
10 changed files with 61 additions and 18 deletions

View File

@@ -20,6 +20,7 @@ import MatrixRustSDK
class UserSessionStore: UserSessionStoreProtocol {
private let keychainController: KeychainControllerProtocol
private let appHooks: AppHooks
private let matrixSDKStateKey = "matrix-sdk-state"
/// Whether or not there are sessions in the store.
@@ -29,8 +30,9 @@ class UserSessionStore: UserSessionStoreProtocol {
var clientSessionDelegate: ClientSessionDelegate { keychainController }
init(keychainController: KeychainControllerProtocol) {
init(keychainController: KeychainControllerProtocol, appHooks: AppHooks) {
self.keychainController = keychainController
self.appHooks = appHooks
}
/// Deletes all data stored in the shared container and keychain
@@ -120,7 +122,8 @@ class UserSessionStore: UserSessionStoreProtocol {
let builder = ClientBuilder
.baseBuilder(httpProxy: URL(string: homeserverURL)?.globalProxy,
sessionDelegate: keychainController)
sessionDelegate: keychainController,
appHooks: appHooks)
.sessionPath(path: credentials.restorationToken.sessionDirectory.path(percentEncoded: false))
.username(username: credentials.userID)
.homeserverUrl(url: homeserverURL)