]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/impls/private_message_report.rs
Automatically resolve report when post/comment is removed (#3850)
[lemmy.git] / crates / db_schema / src / impls / private_message_report.rs
index ca218796005ba880dc56be12b25d61f2f53edce6..c20783db01988fc927999b7bc0cc6eb231eb8abf 100644 (file)
@@ -1,5 +1,5 @@
 use crate::{
-  newtypes::{PersonId, PrivateMessageReportId},
+  newtypes::{PersonId, PrivateMessageId, PrivateMessageReportId},
   schema::private_message_report::dsl::{private_message_report, resolved, resolver_id, updated},
   source::private_message_report::{PrivateMessageReport, PrivateMessageReportForm},
   traits::Reportable,
@@ -17,6 +17,7 @@ use diesel_async::RunQueryDsl;
 impl Reportable for PrivateMessageReport {
   type Form = PrivateMessageReportForm;
   type IdType = PrivateMessageReportId;
+  type ObjectIdType = PrivateMessageId;
 
   async fn report(
     pool: &mut DbPool<'_>,
@@ -45,6 +46,15 @@ impl Reportable for PrivateMessageReport {
       .await
   }
 
+  // TODO: this is unused because private message doesnt have remove handler
+  async fn resolve_all_for_object(
+    _pool: &mut DbPool<'_>,
+    _pm_id_: PrivateMessageId,
+    _by_resolver_id: PersonId,
+  ) -> Result<usize, Error> {
+    unimplemented!()
+  }
+
   async fn unresolve(
     pool: &mut DbPool<'_>,
     report_id: Self::IdType,