Add content reporting endpoint

This commit is contained in:
iinuwa 2020-01-14 08:20:31 -06:00 committed by Jonas Platte
parent 4a37625ea9
commit 0314384c60
2 changed files with 32 additions and 0 deletions

View File

@ -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};

View 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 {}
}