From 8450af2094c4c1d83005fdc822b196a95da0d1ff Mon Sep 17 00:00:00 2001 From: Timshel Date: Thu, 18 Jun 2026 19:52:09 +0200 Subject: [PATCH] Prevent creating and editing a Send with email verification --- src/api/core/sends.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/api/core/sends.rs b/src/api/core/sends.rs index f8146d1c..87401b52 100644 --- a/src/api/core/sends.rs +++ b/src/api/core/sends.rs @@ -80,6 +80,7 @@ pub struct SendData { deletion_date: DateTime, disabled: bool, hide_email: Option, + emails: Option, // Data field name: String, @@ -150,6 +151,10 @@ fn create_send(data: SendData, user_id: UserId) -> ApiResult { ); } + if data.emails.is_some() { + err!("Sends with email verification is not supported"); + } + let mut send = Send::new(data.r#type, data.name, data_str, data.key, data.deletion_date.naive_utc()); send.user_uuid = Some(user_id); send.notes = data.notes; @@ -635,6 +640,10 @@ async fn put_send(send_id: SendId, data: Json, headers: Headers, conn: err!("Send not found", "Send send_id is invalid or does not belong to user") }; + if data.emails.is_some() { + err!("Sends with email verification is not supported"); + } + update_send_from_data(&mut send, data, &headers, &conn, &nt, UpdateType::SyncSendUpdate).await?; Ok(Json(send.to_json()))