revolt_models/v0/safety_reports.rs
1use iso8601_timestamp::Timestamp;
2
3auto_derived!(
4 /// User-generated platform moderation report
5 pub struct Report {
6 /// Unique Id
7 #[serde(rename = "_id")]
8 pub id: String,
9 /// Id of the user creating this report
10 pub author_id: String,
11 /// Reported content
12 pub content: ReportedContent,
13 /// Additional report context
14 pub additional_context: String,
15 /// Status of the report
16 #[serde(flatten)]
17 pub status: ReportStatus,
18 /// Additional notes included on the report
19 #[serde(default)]
20 pub notes: String,
21 }
22
23 /// Reason for reporting content (message or server)
24 pub enum ContentReportReason {
25 /// No reason has been specified
26 NoneSpecified,
27
28 /// Illegal content catch-all reason
29 Illegal,
30
31 /// Selling or facilitating use of drugs or other illegal goods
32 IllegalGoods,
33
34 /// Extortion or blackmail
35 IllegalExtortion,
36
37 /// Revenge or child pornography
38 IllegalPornography,
39
40 /// Illegal hacking activity
41 IllegalHacking,
42
43 /// Extreme violence, gore, or animal cruelty
44 /// With exception to violence potrayed in media / creative arts
45 ExtremeViolence,
46
47 /// Content that promotes harm to others / self
48 PromotesHarm,
49
50 /// Unsolicited advertisements
51 UnsolicitedSpam,
52
53 /// This is a raid
54 Raid,
55
56 /// Spam or platform abuse
57 SpamAbuse,
58
59 /// Scams or fraud
60 ScamsFraud,
61
62 /// Distribution of malware or malicious links
63 Malware,
64
65 /// Harassment or abuse targeted at another user
66 Harassment,
67 }
68
69 /// Reason for reporting a user
70 pub enum UserReportReason {
71 /// No reason has been specified
72 NoneSpecified,
73
74 /// Unsolicited advertisements
75 UnsolicitedSpam,
76
77 /// User is sending spam or otherwise abusing the platform
78 SpamAbuse,
79
80 /// User's profile contains inappropriate content for a general audience
81 InappropriateProfile,
82
83 /// User is impersonating another user
84 Impersonation,
85
86 /// User is evading a ban
87 BanEvasion,
88
89 /// User is not of minimum age to use the platform
90 Underage,
91 }
92
93 /// The content being reported
94 #[serde(tag = "type")]
95 pub enum ReportedContent {
96 /// Report a message
97 Message {
98 /// ID of the message
99 id: String,
100 /// Reason for reporting message
101 report_reason: ContentReportReason,
102 },
103 /// Report a server
104 Server {
105 /// ID of the server
106 id: String,
107 /// Reason for reporting server
108 report_reason: ContentReportReason,
109 },
110 /// Report a user
111 User {
112 /// ID of the user
113 id: String,
114 /// Reason for reporting a user
115 report_reason: UserReportReason,
116 /// Message context
117 message_id: Option<String>,
118 },
119 }
120
121 /// Status of the report
122 #[serde(tag = "status")]
123 pub enum ReportStatus {
124 /// Report is waiting for triage / action
125 Created {},
126
127 /// Report was rejected
128 Rejected {
129 rejection_reason: String,
130 closed_at: Option<Timestamp>,
131 },
132
133 /// Report was actioned and resolved
134 Resolved { closed_at: Option<Timestamp> },
135 }
136
137 /// Just the status of the report
138 pub enum ReportStatusString {
139 /// Report is waiting for triage / action
140 Created,
141
142 /// Report was rejected
143 Rejected,
144
145 /// Report was actioned and resolved
146 Resolved,
147 }
148);