Removed now unused loadDisplayName room proxy method

This commit is contained in:
Stefan Ceriu
2022-11-28 15:02:08 +02:00
committed by Stefan Ceriu
parent 849e126eb0
commit cf44ffb454
3 changed files with 1 additions and 23 deletions
@@ -50,11 +50,7 @@ struct MockRoomProxy: RoomProxyProtocol {
func displayNameForUserId(_ userId: String) -> String? { func displayNameForUserId(_ userId: String) -> String? {
nil nil
} }
func loadDisplayName() async -> Result<String, RoomProxyError> {
.failure(.failedRetrievingDisplayName)
}
func startLiveEventListener() { } func startLiveEventListener() { }
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> { func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> {
@@ -129,21 +129,7 @@ class RoomProxy: RoomProxyProtocol {
return .failure(.failedRetrievingMemberDisplayName) return .failure(.failedRetrievingMemberDisplayName)
} }
} }
func loadDisplayName() async -> Result<String, RoomProxyError> {
if let displayName { return .success(displayName) }
do {
let displayName = try await Task.dispatch(on: serialDispatchQueue) {
try self.room.displayName()
}
update(displayName: displayName)
return .success(displayName)
} catch {
return .failure(.failedRetrievingDisplayName)
}
}
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> { func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> {
room.addTimelineListener(listener: listener) room.addTimelineListener(listener: listener)
return .success(()) return .success(())
@@ -18,8 +18,6 @@ import Combine
import MatrixRustSDK import MatrixRustSDK
enum RoomProxyError: Error { enum RoomProxyError: Error {
case failedRetrievingDisplayName
case failedRetrievingAvatar
case noMoreMessagesToBackPaginate case noMoreMessagesToBackPaginate
case failedPaginatingBackwards case failedPaginatingBackwards
case failedRetrievingMemberAvatarURL case failedRetrievingMemberAvatarURL
@@ -53,8 +51,6 @@ protocol RoomProxyProtocol {
func loadDisplayNameForUserId(_ userId: String) async -> Result<String?, RoomProxyError> func loadDisplayNameForUserId(_ userId: String) async -> Result<String?, RoomProxyError>
func loadDisplayName() async -> Result<String, RoomProxyError>
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError>
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError> func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError>