client-api: Make score and reason optional in room::report_content::Request

This commit is contained in:
Kévin Commaille 2022-02-22 19:23:43 +01:00 committed by GitHub
parent 412452ea2e
commit f78ae4ddde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,12 +31,12 @@ pub mod v3 {
pub event_id: &'a EventId, pub event_id: &'a EventId,
/// Integer between -100 and 0 rating offensivness. /// Integer between -100 and 0 rating offensivness.
pub score: Int, pub score: Option<Int>,
/// Reason to report content. /// Reason to report content.
/// ///
/// May be blank. /// May be blank.
pub reason: &'a str, pub reason: Option<&'a str>,
} }
#[derive(Default)] #[derive(Default)]
@ -50,8 +50,8 @@ pub mod v3 {
pub fn new( pub fn new(
room_id: &'a RoomId, room_id: &'a RoomId,
event_id: &'a EventId, event_id: &'a EventId,
score: Int, score: Option<Int>,
reason: &'a str, reason: Option<&'a str>,
) -> Self { ) -> Self {
Self { room_id, event_id, score, reason } Self { room_id, event_id, score, reason }
} }