mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 15:45:11 +00:00
Introduce a user session manager (#6295)
This commit is contained in:
@@ -10,7 +10,7 @@ import Foundation
|
||||
import MatrixRustSDK
|
||||
|
||||
enum UserSessionStoreError: Error {
|
||||
case missingCredentials
|
||||
case unknownAccount
|
||||
case failedRestoringLogin
|
||||
case failedSettingUpSession
|
||||
case failedSettingUpClientProxy(Error)
|
||||
@@ -30,8 +30,8 @@ protocol UserSessionStoreProtocol {
|
||||
/// Returns the delegate that should handle any changes to a `Client`'s `Session`.
|
||||
var clientSessionDelegate: ClientSessionDelegate { get }
|
||||
|
||||
/// Restores an existing user session.
|
||||
func restoreUserSession() async -> Result<UserSessionProtocol, UserSessionStoreError>
|
||||
/// Restores the session of the given account. If this fails, the account's credentials and data are deleted.
|
||||
func restoreUserSession(userID: String) async -> Result<UserSessionProtocol, UserSessionStoreError>
|
||||
|
||||
/// Creates a user session for a new client from the SDK along with the passphrase used for the data stores.
|
||||
func userSession(for client: ClientProtocol, sessionDirectories: SessionDirectories, passphrase: Data) async -> Result<UserSessionProtocol, UserSessionStoreError>
|
||||
|
||||
Reference in New Issue
Block a user