]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/source/community.rs
Hide community v2 (#2055)
[lemmy.git] / crates / db_schema / src / source / community.rs
index 269e7dbf9a8bd220df1272506bf92885452c0839..35b695db0448b0453a43e11b034d3738eb9447c8 100644 (file)
@@ -26,6 +26,7 @@ pub struct Community {
   pub followers_url: DbUrl,
   pub inbox_url: DbUrl,
   pub shared_inbox_url: Option<DbUrl>,
+  pub hidden: bool,
 }
 
 /// A safe representation of community, without the sensitive info
@@ -45,6 +46,7 @@ pub struct CommunitySafe {
   pub local: bool,
   pub icon: Option<DbUrl>,
   pub banner: Option<DbUrl>,
+  pub hidden: bool,
 }
 
 #[derive(Insertable, AsChangeset, Debug, Default)]
@@ -68,6 +70,7 @@ pub struct CommunityForm {
   pub followers_url: Option<DbUrl>,
   pub inbox_url: Option<DbUrl>,
   pub shared_inbox_url: Option<Option<DbUrl>>,
+  pub hidden: Option<bool>,
 }
 
 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
@@ -95,6 +98,7 @@ pub struct CommunityPersonBan {
   pub community_id: CommunityId,
   pub person_id: PersonId,
   pub published: chrono::NaiveDateTime,
+  pub expires: Option<chrono::NaiveDateTime>,
 }
 
 #[derive(Insertable, AsChangeset, Clone)]
@@ -102,6 +106,7 @@ pub struct CommunityPersonBan {
 pub struct CommunityPersonBanForm {
   pub community_id: CommunityId,
   pub person_id: PersonId,
+  pub expires: Option<Option<chrono::NaiveDateTime>>,
 }
 
 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]