mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Report Content (#587)
* ui for reporting content has been implemented * implementation done, will only work withe a mx rust sdk that supports report content * fix * code improvements * code improvement * fix typo Co-authored-by: Stefan Ceriu <stefanc@matrix.org> * removing unneeded task * code improvement * changelog --------- Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
@@ -64,6 +64,8 @@ class MockRoomTimelineController: RoomTimelineControllerProtocol {
|
||||
func editMessage(_ newMessage: String, original itemID: String) async { }
|
||||
|
||||
func redact(_ itemID: String) async { }
|
||||
|
||||
func reportContent(_ itemID: String, reason: String?) async { }
|
||||
|
||||
func debugDescription(for itemID: String) -> String {
|
||||
"Mock debug description"
|
||||
|
||||
@@ -187,6 +187,16 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
|
||||
MXLog.error("Failed redacting message with error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
func reportContent(_ itemID: String, reason: String?) async {
|
||||
MXLog.info("Send report content in \(roomID)")
|
||||
switch await roomProxy.reportContent(itemID, reason: reason) {
|
||||
case .success:
|
||||
MXLog.info("Finished reporting content")
|
||||
case .failure(let error):
|
||||
MXLog.error("Failed reporting content with error: \(error)")
|
||||
}
|
||||
}
|
||||
|
||||
// Handle this parallel to the timeline items so we're not forced
|
||||
// to bundle the Rust side objects within them
|
||||
|
||||
+2
@@ -59,6 +59,8 @@ protocol RoomTimelineControllerProtocol {
|
||||
func sendReaction(_ reaction: String, to itemID: String) async
|
||||
|
||||
func redact(_ itemID: String) async
|
||||
|
||||
func reportContent(_ itemID: String, reason: String?) async
|
||||
|
||||
func debugDescription(for itemID: String) -> String
|
||||
|
||||
|
||||
Reference in New Issue
Block a user