Compare commits

...
Author SHA1 Message Date
phoenix d959162b43 Fix bug
Release Tagging / release (pull_request) Successful in 36s
swoosh Build / Check (pull_request) Successful in 1m33s
swoosh Build / Test Suite (pull_request) Successful in 1m20s
swoosh Build / Rustfmt (pull_request) Successful in 26s
swoosh Build / build (pull_request) Successful in 1m11s
swoosh Build / Clippy (pull_request) Successful in 1m35s
2026-06-07 15:08:22 -04:00
phoenix 4adbfdf712 Using constant 2026-06-07 15:05:25 -04:00
phoenix 3d1720e020 Removing comments 2026-06-07 15:03:29 -04:00
+4 -15
View File
@@ -32,17 +32,11 @@ pub async fn send_mssage(
let mut params = std::collections::HashMap::new();
params.insert("To", contact.phone_number.as_str());
// params.insert("StatusCallback", "http://OjQozHznkhNTTR.vpnrM1zdXFuiQ");
// params.insert("MaxPrice", "1");
params.insert("ProvideFeedback", "true");
// params.insert("Attempt", "5");
// params.insert("ValidityPeriod", "1537");
params.insert("ForceDelivery", "false");
params.insert("ContentRetention", "retain");
params.insert("AddressRetention", "obfuscate");
params.insert("SmartEncoded", "true");
// params.insert("PersistentAction", "string");
// params.insert("PersistentAction", "string");
params.insert("ShortenUrls", "true");
let date = match param.schedule_at {
Some(date_value) => date_value.to_string(),
@@ -66,7 +60,7 @@ pub async fn send_mssage(
let request = client.post(url).headers(headers).form(&params);
match request.send().await {
Ok(response) => match response.status() {
reqwest::StatusCode::OK => Ok(response),
reqwest::StatusCode::CREATED => Ok(response),
status => Err(std::io::Error::other(format!(
"Unaccounted status: {status:?}"
))),
@@ -104,15 +98,10 @@ fn generate_auth(
params.insert("ShortenUrls", "true");
params.insert("SendAsMms", "true");
params.insert("RiskCheck", "enable");
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
*/
const DEFAULT_SCHEDULING_SECONDS: i64 = 300;
fn is_scheduleable(
now: &Option<time::OffsetDateTime>,
scheduled: &Option<time::OffsetDateTime>,
@@ -121,7 +110,7 @@ fn is_scheduleable(
Some(schedule_at) => {
let early = now
.unwrap()
.checked_add(time::Duration::seconds(300))
.checked_add(time::Duration::seconds(DEFAULT_SCHEDULING_SECONDS))
.unwrap();
*schedule_at > early
}