mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
feat: decline and block screen
fix improvement fix conflict fix tests tests
This commit is contained in:
@@ -529,6 +529,20 @@ class ClientProxy: ClientProxyProtocol {
|
||||
func roomSummaryForAlias(_ alias: String) -> RoomSummary? {
|
||||
staticRoomSummaryProvider.roomListPublisher.value.first { $0.canonicalAlias == alias || $0.alternativeAliases.contains(alias) }
|
||||
}
|
||||
|
||||
func reportRoomForIdentifier(_ identifier: String, reason: String?) async -> Result<Void, ClientProxyError> {
|
||||
do {
|
||||
guard let room = try client.getRoom(roomId: identifier) else {
|
||||
MXLog.error("Failed reporting room with identifier: \(identifier), room not in local store")
|
||||
return .failure(.roomNotInLocalStore)
|
||||
}
|
||||
try await room.reportRoom(reason: reason)
|
||||
return .success(())
|
||||
} catch {
|
||||
MXLog.error("Failed reporting room with identifier: \(identifier), with error: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func loadUserDisplayName() async -> Result<Void, ClientProxyError> {
|
||||
do {
|
||||
|
||||
@@ -38,6 +38,7 @@ enum ClientProxyError: Error {
|
||||
case roomPreviewIsPrivate
|
||||
case failedRetrievingUserIdentity
|
||||
case failedResolvingRoomAlias
|
||||
case roomNotInLocalStore
|
||||
}
|
||||
|
||||
enum SlidingSyncConstants {
|
||||
@@ -152,6 +153,9 @@ protocol ClientProxyProtocol: AnyObject, MediaLoaderProtocol {
|
||||
|
||||
func roomSummaryForAlias(_ alias: String) -> RoomSummary?
|
||||
|
||||
/// Will only work for rooms that are in our room list/local store
|
||||
func reportRoomForIdentifier(_ identifier: String, reason: String?) async -> Result<Void, ClientProxyError>
|
||||
|
||||
@discardableResult func loadUserDisplayName() async -> Result<Void, ClientProxyError>
|
||||
|
||||
func setUserDisplayName(_ name: String) async -> Result<Void, ClientProxyError>
|
||||
|
||||
Reference in New Issue
Block a user