Add Block user to Report Content screen. (#742)

This commit is contained in:
Doug
2023-04-03 10:21:24 +01:00
committed by GitHub
parent 7d1ab997ce
commit 220138d492
33 changed files with 220 additions and 130 deletions
@@ -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