mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 03:06:37 +00:00
Cached avatar support (from Rust) (#633)
* loading a cached avatar at first, and then actually doing the request so that the avatar can still be displayed without connection * improved the code * fix + changelog * policy on how to fetch the avatar url added * code improvements * addressed al PR comments * improved the error handling * improved the async task code * fixed a typo * fixed another typo
This commit is contained in:
@@ -29,11 +29,15 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
var visibleRoomsSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
|
||||
var allRoomsSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()
|
||||
|
||||
var avatarURLPublisher: AnyPublisher<URL?, Never> { Empty().eraseToAnyPublisher() }
|
||||
|
||||
internal init(userID: String, roomSummaryProvider: RoomSummaryProviderProtocol? = MockRoomSummaryProvider()) {
|
||||
self.userID = userID
|
||||
visibleRoomsSummaryProvider = roomSummaryProvider
|
||||
}
|
||||
|
||||
func loadUserAvatarURL() async { }
|
||||
|
||||
func startSync() { }
|
||||
|
||||
@@ -56,10 +60,6 @@ class MockClientProxy: ClientProxyProtocol {
|
||||
.success("User display name")
|
||||
}
|
||||
|
||||
func loadUserAvatarURL() async -> Result<URL, ClientProxyError> {
|
||||
.failure(.failedRetrievingAvatarURL)
|
||||
}
|
||||
|
||||
func accountDataEvent<Content>(type: String) async -> Result<Content?, ClientProxyError> where Content: Decodable {
|
||||
.failure(.failedRetrievingAccountData)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user