account confirmation

This commit is contained in:
Mateusz Gruszczyński
2026-07-22 19:20:30 +02:00
parent d5ec8a28e7
commit 7c38edeef7
14 changed files with 193 additions and 17 deletions
+3 -2
View File
@@ -24,13 +24,14 @@ pub struct AppState {
pub upload_max_size_bytes: usize,
pub smtp: Option<SmtpConfig>,
pub registration_enabled: bool,
pub account_confirmation_required: bool,
pub frontend_log_level: String,
channels: RwLock<HashMap<String, broadcast::Sender<NoteUpdate>>>,
}
impl AppState {
pub fn new(db: Database, asset_version: String, files_dir: String, upload_max_size_bytes: usize, smtp: Option<SmtpConfig>, registration_enabled: bool, frontend_log_level: String) -> Self {
Self { db, asset_version, files_dir, upload_max_size_bytes, smtp, registration_enabled, frontend_log_level, channels: RwLock::new(HashMap::new()) }
pub fn new(db: Database, asset_version: String, files_dir: String, upload_max_size_bytes: usize, smtp: Option<SmtpConfig>, registration_enabled: bool, account_confirmation_required: bool, frontend_log_level: String) -> Self {
Self { db, asset_version, files_dir, upload_max_size_bytes, smtp, registration_enabled, account_confirmation_required, frontend_log_level, channels: RwLock::new(HashMap::new()) }
}
async fn channel_for_key(&self, key: String) -> broadcast::Sender<NoteUpdate> {
if let Some(sender) = self.channels.read().await.get(&key) { return sender.clone(); }