lepši systém noko/sage
Tento commit je obsažen v:
rodič
01e0c8aeee
revize
ec141bc69e
@ -31,6 +31,7 @@ pub struct ServerCfg {
|
||||
pub struct SiteCfg {
|
||||
pub name: String,
|
||||
pub description: String,
|
||||
pub default_noko: bool,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone)]
|
||||
|
@ -66,7 +66,7 @@ pub async fn create_post(
|
||||
}
|
||||
|
||||
let mut bumpy_bump = true;
|
||||
let mut noko = true;
|
||||
let mut noko = ctx.cfg.site.default_noko;
|
||||
|
||||
let thread = match form.thread {
|
||||
Some(Text(thread)) => {
|
||||
@ -143,12 +143,18 @@ pub async fn create_post(
|
||||
return Err(NekrochanError::EmailFormatError);
|
||||
}
|
||||
|
||||
if email_raw == "sage" || email_raw == "nonokosage" {
|
||||
let email_lower = email_raw.to_lowercase();
|
||||
|
||||
if email_lower.contains("sage") {
|
||||
bumpy_bump = false;
|
||||
}
|
||||
|
||||
if email_raw == "nonoko" || email_raw == "nonokosage" {
|
||||
noko = false;
|
||||
if !ctx.cfg.site.default_noko && email_lower.contains("noko") {
|
||||
noko = true
|
||||
}
|
||||
|
||||
if ctx.cfg.site.default_noko && email_lower.contains("nonoko") {
|
||||
noko = false
|
||||
}
|
||||
|
||||
Some(email_raw.into())
|
||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele