-use crate::newtypes::{LocalSiteId, SiteId};
#[cfg(feature = "full")]
use crate::schema::local_site;
+use crate::{
+ newtypes::{LocalSiteId, SiteId},
+ ListingType,
+ RegistrationMode,
+};
use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder;
pub application_question: Option<String>,
pub private_instance: bool,
pub default_theme: String,
- pub default_post_listing_type: String,
+ pub default_post_listing_type: ListingType,
pub legal_information: Option<String>,
pub hide_modlog_mod_names: bool,
pub application_email_admins: bool,
pub federation_worker_count: i32,
pub captcha_enabled: bool,
pub captcha_difficulty: String,
- pub registration_mode: RegistrationMode,
pub published: chrono::NaiveDateTime,
pub updated: Option<chrono::NaiveDateTime>,
+ pub registration_mode: RegistrationMode,
+ pub reports_email_admins: bool,
}
#[derive(Clone, TypedBuilder)]
pub application_question: Option<String>,
pub private_instance: Option<bool>,
pub default_theme: Option<String>,
- pub default_post_listing_type: Option<String>,
+ pub default_post_listing_type: Option<ListingType>,
pub legal_information: Option<String>,
pub hide_modlog_mod_names: Option<bool>,
pub application_email_admins: Option<bool>,
pub captcha_enabled: Option<bool>,
pub captcha_difficulty: Option<String>,
pub registration_mode: Option<RegistrationMode>,
+ pub reports_email_admins: Option<bool>,
}
#[derive(Clone, TypedBuilder)]
pub application_question: Option<Option<String>>,
pub private_instance: Option<bool>,
pub default_theme: Option<String>,
- pub default_post_listing_type: Option<String>,
+ pub default_post_listing_type: Option<ListingType>,
pub legal_information: Option<Option<String>>,
pub hide_modlog_mod_names: Option<bool>,
pub application_email_admins: Option<bool>,
pub captcha_enabled: Option<bool>,
pub captcha_difficulty: Option<String>,
pub registration_mode: Option<RegistrationMode>,
+ pub reports_email_admins: Option<bool>,
pub updated: Option<Option<chrono::NaiveDateTime>>,
}
-
-#[cfg(feature = "full")]
-#[derive(SqlType)]
-#[diesel(postgres_type(name = "registration_mode_enum"))]
-pub struct RegistrationModeType;
-
-#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
-#[cfg_attr(feature = "full", derive(FromSqlRow, AsExpression))]
-#[cfg_attr(feature = "full", diesel(sql_type = RegistrationModeType))]
-#[serde(rename_all = "lowercase")]
-pub enum RegistrationMode {
- Closed,
- RequireApplication,
- Open,
-}