Add content reporting endpoint
This commit is contained in:
parent
4a37625ea9
commit
0314384c60
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
pub mod create_room;
|
pub mod create_room;
|
||||||
pub mod get_room_event;
|
pub mod get_room_event;
|
||||||
|
pub mod report_content;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
31
src/r0/room/report_content.rs
Normal file
31
src/r0/room/report_content.rs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
//! [POST /_matrix/client/r0/rooms/{roomId}/report/{eventId}](https://matrix.org/docs/spec/client_server/r0.6.0#post-matrix-client-r0-rooms-roomid-report-eventid)
|
||||||
|
|
||||||
|
use js_int::Int;
|
||||||
|
use ruma_api::ruma_api;
|
||||||
|
use ruma_identifiers::{EventId, RoomId};
|
||||||
|
|
||||||
|
ruma_api! {
|
||||||
|
metadata {
|
||||||
|
description: "Report content as inappropriate.",
|
||||||
|
method: POST,
|
||||||
|
name: "report_content",
|
||||||
|
path: "/rooms/:room_id/report/:event_id",
|
||||||
|
rate_limited: false,
|
||||||
|
requires_authentication: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
request {
|
||||||
|
/// Room in which the event to be reported is located.
|
||||||
|
#[ruma_api(path)]
|
||||||
|
room_id: RoomId,
|
||||||
|
/// Event to report.
|
||||||
|
#[ruma_api(path)]
|
||||||
|
event_id: EventId,
|
||||||
|
/// Integer between -100 and 0 rating offensivness.
|
||||||
|
score: Int,
|
||||||
|
/// Reason to report content. May be blank.
|
||||||
|
reason: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
response {}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user