Removed now unused loadDisplayName room proxy method
This commit is contained in:
committed by
Stefan Ceriu
parent
c1c5d399fa
commit
df02fef22e
@@ -50,11 +50,7 @@ struct MockRoomProxy: RoomProxyProtocol {
|
||||
func displayNameForUserId(_ userId: String) -> String? {
|
||||
nil
|
||||
}
|
||||
|
||||
func loadDisplayName() async -> Result<String, RoomProxyError> {
|
||||
.failure(.failedRetrievingDisplayName)
|
||||
}
|
||||
|
||||
|
||||
func startLiveEventListener() { }
|
||||
|
||||
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError> {
|
||||
|
||||
@@ -129,21 +129,7 @@ class RoomProxy: RoomProxyProtocol {
|
||||
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> {
|
||||
room.addTimelineListener(listener: listener)
|
||||
return .success(())
|
||||
|
||||
@@ -18,8 +18,6 @@ import Combine
|
||||
import MatrixRustSDK
|
||||
|
||||
enum RoomProxyError: Error {
|
||||
case failedRetrievingDisplayName
|
||||
case failedRetrievingAvatar
|
||||
case noMoreMessagesToBackPaginate
|
||||
case failedPaginatingBackwards
|
||||
case failedRetrievingMemberAvatarURL
|
||||
@@ -53,8 +51,6 @@ protocol RoomProxyProtocol {
|
||||
|
||||
func loadDisplayNameForUserId(_ userId: String) async -> Result<String?, RoomProxyError>
|
||||
|
||||
func loadDisplayName() async -> Result<String, RoomProxyError>
|
||||
|
||||
func addTimelineListener(listener: TimelineListener) -> Result<Void, RoomProxyError>
|
||||
|
||||
func paginateBackwards(count: UInt) async -> Result<Void, RoomProxyError>
|
||||
|
||||
Reference in New Issue
Block a user