]> Untitled Git - lemmy.git/blobdiff - crates/db_views/src/structs.rs
Diesel 2.0.0 upgrade (#2452)
[lemmy.git] / crates / db_views / src / structs.rs
index a3c11171228ef258a3b36bd8cac377964fd529b3..83f1e122d38c3d7f988767bbc89c3d1f2650ce39 100644 (file)
@@ -6,10 +6,11 @@ use lemmy_db_schema::{
     community::CommunitySafe,
     language::Language,
     local_user::{LocalUser, LocalUserSettings},
-    person::{Person, PersonSafe, PersonSafeAlias1, PersonSafeAlias2},
+    person::{Person, PersonSafe},
     post::Post,
     post_report::PostReport,
     private_message::PrivateMessage,
+    private_message_report::PrivateMessageReport,
     registration_application::RegistrationApplication,
     site::Site,
   },
@@ -17,21 +18,21 @@ use lemmy_db_schema::{
 };
 use serde::{Deserialize, Serialize};
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct CommentReportView {
   pub comment_report: CommentReport,
   pub comment: Comment,
   pub post: Post,
   pub community: CommunitySafe,
   pub creator: PersonSafe,
-  pub comment_creator: PersonSafeAlias1,
+  pub comment_creator: PersonSafe,
   pub counts: CommentAggregates,
   pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
   pub my_vote: Option<i16>,                // Left join to CommentLike
-  pub resolver: Option<PersonSafeAlias2>,
+  pub resolver: Option<PersonSafe>,
 }
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct CommentView {
   pub comment: Comment,
   pub creator: PersonSafe,
@@ -59,20 +60,20 @@ pub struct LocalUserSettingsView {
   pub counts: PersonAggregates,
 }
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct PostReportView {
   pub post_report: PostReport,
   pub post: Post,
   pub community: CommunitySafe,
   pub creator: PersonSafe,
-  pub post_creator: PersonSafeAlias1,
+  pub post_creator: PersonSafe,
   pub creator_banned_from_community: bool,
   pub my_vote: Option<i16>,
   pub counts: PostAggregates,
-  pub resolver: Option<PersonSafeAlias2>,
+  pub resolver: Option<PersonSafe>,
 }
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct PostView {
   pub post: Post,
   pub creator: PersonSafe,
@@ -87,19 +88,28 @@ pub struct PostView {
   pub language: Language,
 }
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct PrivateMessageView {
   pub private_message: PrivateMessage,
   pub creator: PersonSafe,
-  pub recipient: PersonSafeAlias1,
+  pub recipient: PersonSafe,
 }
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
+pub struct PrivateMessageReportView {
+  pub private_message_report: PrivateMessageReport,
+  pub private_message: PrivateMessage,
+  pub private_message_creator: PersonSafe,
+  pub creator: PersonSafe,
+  pub resolver: Option<PersonSafe>,
+}
+
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct RegistrationApplicationView {
   pub registration_application: RegistrationApplication,
   pub creator_local_user: LocalUserSettings,
   pub creator: PersonSafe,
-  pub admin: Option<PersonSafeAlias1>,
+  pub admin: Option<PersonSafe>,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]