]> Untitled Git - lemmy.git/blobdiff - crates/db_views_actor/src/structs.rs
Diesel 2.0.0 upgrade (#2452)
[lemmy.git] / crates / db_views_actor / src / structs.rs
index 25d2c178e4163929175a850ae86d23a6a3106cbe..91d40e9627ee916940158f74be99fb83fbb133c1 100644 (file)
@@ -2,11 +2,13 @@ use lemmy_db_schema::{
   aggregates::structs::{CommentAggregates, CommunityAggregates, PersonAggregates},
   source::{
     comment::Comment,
+    comment_reply::CommentReply,
     community::CommunitySafe,
-    person::{PersonSafe, PersonSafeAlias1},
+    person::PersonSafe,
     person_mention::PersonMention,
     post::Post,
   },
+  SubscribedType,
 };
 use serde::{Deserialize, Serialize};
 
@@ -20,7 +22,6 @@ pub struct CommunityBlockView {
 pub struct CommunityFollowerView {
   pub community: CommunitySafe,
   pub follower: PersonSafe,
-  pub pending: Option<bool>,
 }
 
 #[derive(Debug, Serialize, Deserialize, Clone)]
@@ -38,7 +39,7 @@ pub struct CommunityPersonBanView {
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct CommunityView {
   pub community: CommunitySafe,
-  pub subscribed: bool,
+  pub subscribed: SubscribedType,
   pub blocked: bool,
   pub counts: CommunityAggregates,
 }
@@ -46,20 +47,36 @@ pub struct CommunityView {
 #[derive(Debug, Serialize, Deserialize, Clone)]
 pub struct PersonBlockView {
   pub person: PersonSafe,
-  pub target: PersonSafeAlias1,
+  pub target: PersonSafe,
 }
 
-#[derive(Debug, PartialEq, Serialize, Deserialize, Clone)]
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
 pub struct PersonMentionView {
   pub person_mention: PersonMention,
   pub comment: Comment,
   pub creator: PersonSafe,
   pub post: Post,
   pub community: CommunitySafe,
-  pub recipient: PersonSafeAlias1,
+  pub recipient: PersonSafe,
   pub counts: CommentAggregates,
   pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
-  pub subscribed: bool,                    // Left join to CommunityFollower
+  pub subscribed: SubscribedType,          // Left join to CommunityFollower
+  pub saved: bool,                         // Left join to CommentSaved
+  pub creator_blocked: bool,               // Left join to PersonBlock
+  pub my_vote: Option<i16>,                // Left join to CommentLike
+}
+
+#[derive(Debug, PartialEq, Eq, Serialize, Deserialize, Clone)]
+pub struct CommentReplyView {
+  pub comment_reply: CommentReply,
+  pub comment: Comment,
+  pub creator: PersonSafe,
+  pub post: Post,
+  pub community: CommunitySafe,
+  pub recipient: PersonSafe,
+  pub counts: CommentAggregates,
+  pub creator_banned_from_community: bool, // Left Join to CommunityPersonBan
+  pub subscribed: SubscribedType,          // Left join to CommunityFollower
   pub saved: bool,                         // Left join to CommentSaved
   pub creator_blocked: bool,               // Left join to PersonBlock
   pub my_vote: Option<i16>,                // Left join to CommentLike