]> 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 4c351b8860b0e295840e0065faf861fe006be1a5..35b695db0448b0453a43e11b034d3738eb9447c8 100644 (file)
@@ -19,13 +19,14 @@ pub struct Community {
   pub actor_id: DbUrl,
   pub local: bool,
   pub private_key: Option<String>,
-  pub public_key: Option<String>,
+  pub public_key: String,
   pub last_refreshed_at: chrono::NaiveDateTime,
   pub icon: Option<DbUrl>,
   pub banner: Option<DbUrl>,
   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)]
@@ -60,14 +62,15 @@ pub struct CommunityForm {
   pub nsfw: Option<bool>,
   pub actor_id: Option<DbUrl>,
   pub local: Option<bool>,
-  pub private_key: Option<String>,
-  pub public_key: Option<String>,
+  pub private_key: Option<Option<String>>,
+  pub public_key: String,
   pub last_refreshed_at: Option<chrono::NaiveDateTime>,
   pub icon: Option<Option<DbUrl>>,
   pub banner: Option<Option<DbUrl>>,
   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)]