mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add Block user to Report Content screen. (#742)
This commit is contained in:
@@ -288,6 +288,22 @@ class RoomProxy: RoomProxyProtocol {
|
||||
return .failure(.failedRetrievingMembers)
|
||||
}
|
||||
}
|
||||
|
||||
func ignoreUser(_ userID: String) async -> Result<Void, RoomProxyError> {
|
||||
sendMessageBackgroundTask = backgroundTaskService.startBackgroundTask(withName: backgroundTaskName, isReusable: true)
|
||||
defer {
|
||||
sendMessageBackgroundTask?.stop()
|
||||
}
|
||||
|
||||
return await Task.dispatch(on: userInitiatedDispatchQueue) {
|
||||
do {
|
||||
try self.room.ignoreUser(userId: userID)
|
||||
return .success(())
|
||||
} catch {
|
||||
return .failure(.failedReportingContent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
private func buildRoomMemberProxies(members: [RoomMember]) -> [RoomMemberProxy] {
|
||||
|
||||
@@ -76,10 +76,12 @@ protocol RoomProxyProtocol {
|
||||
func editMessage(_ newMessage: String, original eventID: String) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func redact(_ eventID: String) async -> Result<Void, RoomProxyError>
|
||||
|
||||
|
||||
func reportContent(_ eventID: String, reason: String?) async -> Result<Void, RoomProxyError>
|
||||
|
||||
|
||||
func members() async -> Result<[RoomMemberProxyProtocol], RoomProxyError>
|
||||
|
||||
func ignoreUser(_ userID: String) async -> Result<Void, RoomProxyError>
|
||||
|
||||
func retryDecryption(for sessionID: String) async
|
||||
|
||||
|
||||
Reference in New Issue
Block a user