Adopting different timeline item types exposed from rust.

This commit is contained in:
Stefan Ceriu
2022-03-16 13:30:55 +02:00
parent 44da96c55f
commit 3cc1395fbc
14 changed files with 219 additions and 73 deletions
@@ -0,0 +1,37 @@
//
// RoomProxyProtocol.swift
// ElementX
//
// Created by Stefan Ceriu on 17.02.2022.
//
import UIKit
import Combine
import MatrixRustSDK
enum RoomProxyCallback {
case addedMessage(RoomMessageProtocol)
case updatedLastMessage
}
protocol RoomProxyProtocol {
var id: String { get }
var isDirect: Bool { get }
var isPublic: Bool { get }
var isSpace: Bool { get }
var isEncrypted: Bool { get }
var name: String? { get }
var topic: String? { get }
var lastMessage: String? { get }
var avatarURL: URL? { get }
func loadDisplayName(_ completion: @escaping (Result<String, Error>) -> Void)
func loadAvatar(_ completion: @escaping (Result<UIImage?, Error>) -> Void)
func paginateBackwards(count: UInt, callback: ((Result<[RoomMessageProtocol], Error>) -> Void)?)
var callbacks: PassthroughSubject<RoomProxyCallback, Never> { get }
}