feat(safety): fetch reports and fetch snapshot API

This commit is contained in:
Paul Makles
2023-03-01 11:22:22 +00:00
parent 42b4906594
commit 304336d905
13 changed files with 93 additions and 4 deletions

View File

@@ -44,6 +44,7 @@ pub enum UserReportReason {
Underage,
}
/// The content being reported
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone)]
#[serde(tag = "type")]
pub enum ReportedContent {
@@ -70,6 +71,20 @@ pub enum ReportedContent {
},
}
/// Status of the report
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone)]
#[serde(tag = "status")]
pub enum ReportStatus {
/// Report is waiting for triage / action
Created,
/// Report was rejected
Rejected { rejection_reason: String },
/// Report was actioned and resolved
Resolved,
}
/// User-generated platform moderation report.
#[derive(Serialize, Deserialize, JsonSchema, Debug, Clone)]
pub struct Report {
@@ -82,4 +97,7 @@ pub struct Report {
pub content: ReportedContent,
/// Additional report context
pub additional_context: String,
/// Status of the report
#[serde(flatten)]
pub status: ReportStatus,
}

View File

@@ -9,11 +9,11 @@ use crate::models::{Message, Server, User};
pub enum SnapshotContent {
Message {
/// Context before the message
#[serde(rename = "_prior_context")]
#[serde(rename = "_prior_context", default)]
prior_context: Vec<Message>,
/// Context after the message
#[serde(rename = "_leading_context")]
#[serde(rename = "_leading_context", default)]
leading_context: Vec<Message>,
/// Message