mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-01 09:42:39 +00:00
02eb4b35e2
* Run swiftformat for whitespace. * Run swiftformat with some rules.
42 lines
1.1 KiB
Swift
42 lines
1.1 KiB
Swift
//
|
|
// ClientProxyProtocol.swift
|
|
// ElementX
|
|
//
|
|
// Created by Stefan Ceriu on 26/05/2022.
|
|
// Copyright © 2022 Element. All rights reserved.
|
|
//
|
|
|
|
import Combine
|
|
import Foundation
|
|
import MatrixRustSDK
|
|
|
|
enum ClientProxyCallback {
|
|
case updatedRoomsList
|
|
case receivedSyncUpdate
|
|
}
|
|
|
|
enum ClientProxyError: Error {
|
|
case failedRetrievingAvatarURL
|
|
case failedRetrievingDisplayName
|
|
case failedRetrievingSessionVerificationController
|
|
case failedLoadingMedia
|
|
}
|
|
|
|
protocol ClientProxyProtocol {
|
|
var callbacks: PassthroughSubject<ClientProxyCallback, Never> { get }
|
|
|
|
var userIdentifier: String { get }
|
|
|
|
var rooms: [RoomProxy] { get }
|
|
|
|
func loadUserDisplayName() async -> Result<String, ClientProxyError>
|
|
|
|
func loadUserAvatarURLString() async -> Result<String, ClientProxyError>
|
|
|
|
func mediaSourceForURLString(_ urlString: String) -> MatrixRustSDK.MediaSource
|
|
|
|
func loadMediaContentForSource(_ source: MatrixRustSDK.MediaSource) throws -> Data
|
|
|
|
func sessionVerificationControllerProxy() async -> Result<SessionVerificationControllerProxyProtocol, ClientProxyError>
|
|
}
|