@@ -74,7 +74,7 @@ use ruma::{
74
74
read_marker:: set_read_marker,
75
75
receipt:: create_receipt,
76
76
redact:: redact_event,
77
- room:: { get_room_event, report_content} ,
77
+ room:: { get_room_event, report_content, report_room } ,
78
78
state:: { get_state_events_for_key, send_state_event} ,
79
79
tag:: { create_tag, delete_tag} ,
80
80
typing:: create_typing_event:: { self , v3:: Typing } ,
@@ -3021,6 +3021,23 @@ impl Room {
3021
3021
Ok ( self . client . send ( request) . await ?)
3022
3022
}
3023
3023
3024
+ /// Reports a room as inappropriate to the server.
3025
+ /// The caller is not required to be joined to the room to report it.
3026
+ ///
3027
+ /// # Arguments
3028
+ ///
3029
+ /// * `reason` - The reason the room is being reported.
3030
+ ///
3031
+ /// # Errors
3032
+ ///
3033
+ /// Returns an error if the room is not found or on rate limit
3034
+ pub async fn report_room ( & self , reason : Option < String > ) -> Result < report_room:: v3:: Response > {
3035
+ let mut request = report_room:: v3:: Request :: new ( self . inner . room_id ( ) . to_owned ( ) ) ;
3036
+ request. reason = reason;
3037
+
3038
+ Ok ( self . client . send ( request) . await ?)
3039
+ }
3040
+
3024
3041
/// Set a flag on the room to indicate that the user has explicitly marked
3025
3042
/// it as (un)read.
3026
3043
pub async fn set_unread_flag ( & self , unread : bool ) -> Result < ( ) > {
0 commit comments