Compare commits

..

1 Commits

Author SHA1 Message Date
fe3c67a404 chore(deps): lock file maintenance
Some checks failed
Continuous integration / Check (push) Failing after 2m6s
Continuous integration / Test Suite (push) Failing after 2m13s
Continuous integration / Rustfmt (push) Failing after 1m4s
Continuous integration / Trunk (push) Successful in 2m50s
Continuous integration / build (push) Failing after 2m17s
Continuous integration / Disallow unused dependencies (push) Failing after 4m59s
2026-01-20 18:02:44 +00:00
3 changed files with 101 additions and 147 deletions

153
Cargo.lock generated
View File

@@ -222,9 +222,9 @@ dependencies = [
[[package]]
name = "async-graphql"
version = "7.2.1"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1057a9f7ccf2404d94571dec3451ade1cb524790df6f1ada0d19c2a49f6b0f40"
checksum = "57b75e6d81f69e47038fb2f08c54dc9180fabef56856b7a74e4082157f2e5536"
dependencies = [
"async-graphql-derive",
"async-graphql-parser",
@@ -257,9 +257,9 @@ dependencies = [
[[package]]
name = "async-graphql-axum"
version = "7.2.1"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1e37c5532e4b686acf45e7162bc93da91fc2c702fb0d465efc2c20c8f973795"
checksum = "6197f3d8bc7dae675a5d82ce45316802a0569801ff5ce9cda6d0514cb80bee57"
dependencies = [
"async-graphql",
"axum",
@@ -274,9 +274,9 @@ dependencies = [
[[package]]
name = "async-graphql-derive"
version = "7.2.1"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2e6cbeadc8515e66450fba0985ce722192e28443697799988265d86304d7cc68"
checksum = "8587c1c72749f54250633a725203d537ebda851b68d85c2a8d18a3adc0bf72d6"
dependencies = [
"Inflector",
"async-graphql-parser",
@@ -291,9 +291,9 @@ dependencies = [
[[package]]
name = "async-graphql-parser"
version = "7.2.1"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e64ef70f77a1c689111e52076da1cd18f91834bcb847de0a9171f83624b07fbf"
checksum = "577ec8cb624048d11465439c2b25d28362cb08c154b530421f456debc7083fdf"
dependencies = [
"async-graphql-value",
"pest",
@@ -303,9 +303,9 @@ dependencies = [
[[package]]
name = "async-graphql-value"
version = "7.2.1"
version = "7.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3e3ef112905abea9dea592fc868a6873b10ebd3f983e83308f995d6284e9ba41"
checksum = "e747684314ff7454a1f3b6fe5341e15148b1f17f30c9f6ecc55832dd1f053c47"
dependencies = [
"bytes 1.11.0",
"indexmap 2.13.0",
@@ -845,9 +845,9 @@ dependencies = [
[[package]]
name = "cc"
version = "1.2.52"
version = "1.2.53"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd4932aefd12402b36c60956a4fe0035421f544799057659ff86f923657aada3"
checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932"
dependencies = [
"find-msvc-tools",
"jobserver",
@@ -1137,13 +1137,28 @@ dependencies = [
[[package]]
name = "crc"
version = "3.3.0"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675"
checksum = "49fc9a695bca7f35f5f4c15cddc84415f66a74ea78eef08e90c5024f2b540e23"
dependencies = [
"crc-catalog",
"crc-catalog 1.1.1",
]
[[package]]
name = "crc"
version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5eb8a2a1cd12ab0d987a5d5e825195d372001a4094a0376319d5a0ad71c1ba0d"
dependencies = [
"crc-catalog 2.4.0",
]
[[package]]
name = "crc-catalog"
version = "1.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ccaeedb56da03b09f598226e25e80088cb4cd25f316e6e4df7d695f0feeb1403"
[[package]]
name = "crc-catalog"
version = "2.4.0"
@@ -1725,7 +1740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb"
dependencies = [
"libc",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -1779,9 +1794,9 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
[[package]]
name = "find-msvc-tools"
version = "0.1.7"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f449e6c6c08c865631d4890cfacf252b3d396c9bcc83adb6623cdb02a8336c41"
checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db"
[[package]]
name = "flate2"
@@ -3165,21 +3180,7 @@ dependencies = [
[[package]]
name = "letterbox-notmuch"
version = "0.17.58"
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
checksum = "f781f0347a32a12389882beb046a004862d1692383ef0e078c89bb3e5e374cb7"
dependencies = [
"log",
"mailparse",
"serde",
"serde_json",
"thiserror 2.0.18",
"tracing",
]
[[package]]
name = "letterbox-notmuch"
version = "0.17.61"
version = "0.17.60"
dependencies = [
"itertools",
"log",
@@ -3192,14 +3193,28 @@ dependencies = [
"tracing",
]
[[package]]
name = "letterbox-notmuch"
version = "0.17.60"
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
checksum = "4b07ed7d6b6805d3469ed367eff84d544395f1109039460058f5e5139c1b4112"
dependencies = [
"log",
"mailparse",
"serde",
"serde_json",
"thiserror 2.0.18",
"tracing",
]
[[package]]
name = "letterbox-procmail2notmuch"
version = "0.17.61"
version = "0.17.60"
dependencies = [
"anyhow",
"clap",
"letterbox-notmuch 0.17.58",
"letterbox-shared 0.17.58",
"letterbox-notmuch 0.17.60 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
"letterbox-shared 0.17.60 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
"serde",
"sqlx",
"tokio 1.49.0",
@@ -3207,7 +3222,7 @@ dependencies = [
[[package]]
name = "letterbox-server"
version = "0.17.61"
version = "0.17.60"
dependencies = [
"ammonia",
"anyhow",
@@ -3230,8 +3245,8 @@ dependencies = [
"html-escape",
"html2text",
"ical",
"letterbox-notmuch 0.17.61",
"letterbox-shared 0.17.61",
"letterbox-notmuch 0.17.60",
"letterbox-shared 0.17.60",
"linkify",
"lol_html",
"mailparse",
@@ -3257,12 +3272,10 @@ dependencies = [
[[package]]
name = "letterbox-shared"
version = "0.17.58"
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
checksum = "bdca722142c6ea369113f1f5772f0e951857b72c4e977e194096f67fd7eebc95"
version = "0.17.60"
dependencies = [
"build-info",
"letterbox-notmuch 0.17.58",
"letterbox-notmuch 0.17.60",
"regex",
"serde",
"sqlx",
@@ -3272,10 +3285,12 @@ dependencies = [
[[package]]
name = "letterbox-shared"
version = "0.17.61"
version = "0.17.60"
source = "sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/"
checksum = "3e3a5c07184063c6cbd1e09ae7174b2319dc10ce60e2ecdd5d7db1826c27b94f"
dependencies = [
"build-info",
"letterbox-notmuch 0.17.61",
"letterbox-notmuch 0.17.60 (sparse+https://git.z.xinu.tv/api/packages/wathiede/cargo/)",
"regex",
"serde",
"sqlx",
@@ -3285,7 +3300,7 @@ dependencies = [
[[package]]
name = "letterbox-web"
version = "0.17.61"
version = "0.17.60"
dependencies = [
"build-info",
"build-info-build",
@@ -3297,7 +3312,7 @@ dependencies = [
"graphql_client",
"human_format",
"itertools",
"letterbox-shared 0.17.61",
"letterbox-shared 0.17.60",
"log",
"seed",
"seed_hooks",
@@ -3476,11 +3491,11 @@ checksum = "08ab2867e3eeeca90e844d1940eab391c9dc5228783db2ed999acbc0a9ed375a"
[[package]]
name = "lzma-rust2"
version = "0.15.7"
version = "0.15.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1670343e58806300d87950e3401e820b519b9384281bbabfb15e3636689ffd69"
checksum = "7fa48f5024824ecd3e8282cc948bd46fbd095aed5a98939de0594601a59b4e2b"
dependencies = [
"crc",
"crc 2.1.0",
"sha2 0.10.9",
]
@@ -3833,7 +3848,7 @@ version = "0.50.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5"
dependencies = [
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -4662,7 +4677,7 @@ dependencies = [
"once_cell",
"socket2 0.6.1",
"tracing",
"windows-sys 0.59.0",
"windows-sys 0.60.2",
]
[[package]]
@@ -5222,7 +5237,7 @@ dependencies = [
"errno",
"libc",
"linux-raw-sys",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -5255,9 +5270,9 @@ dependencies = [
[[package]]
name = "rustls-pki-types"
version = "1.13.2"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21e6f2ab2928ca4291b86736a8bd920a277a399bba1589409d72154ff87c1282"
checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd"
dependencies = [
"web-time",
"zeroize",
@@ -5281,7 +5296,7 @@ dependencies = [
"security-framework 3.5.1",
"security-framework-sys",
"webpki-root-certs",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -5292,9 +5307,9 @@ checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f"
[[package]]
name = "rustls-webpki"
version = "0.103.8"
version = "0.103.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52"
checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53"
dependencies = [
"aws-lc-rs",
"ring",
@@ -5774,7 +5789,7 @@ dependencies = [
"base64 0.22.1",
"bytes 1.11.0",
"chrono",
"crc",
"crc 3.4.0",
"crossbeam-queue 0.3.12",
"either",
"event-listener",
@@ -5850,7 +5865,7 @@ dependencies = [
"byteorder",
"bytes 1.11.0",
"chrono",
"crc",
"crc 3.4.0",
"digest 0.10.7",
"dotenvy",
"either",
@@ -5892,7 +5907,7 @@ dependencies = [
"bitflags 2.10.0",
"byteorder",
"chrono",
"crc",
"crc 3.4.0",
"dotenvy",
"etcetera",
"futures-channel",
@@ -6289,7 +6304,7 @@ dependencies = [
"getrandom 0.3.4",
"once_cell",
"rustix",
"windows-sys 0.59.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -7217,9 +7232,9 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
[[package]]
name = "wasip2"
version = "1.0.1+wasi-0.2.4"
version = "1.0.2+wasi-0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
dependencies = [
"wit-bindgen",
]
@@ -7421,7 +7436,7 @@ version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22"
dependencies = [
"windows-sys 0.48.0",
"windows-sys 0.61.2",
]
[[package]]
@@ -7808,9 +7823,9 @@ dependencies = [
[[package]]
name = "wit-bindgen"
version = "0.46.0"
version = "0.51.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
[[package]]
name = "writeable"
@@ -8017,9 +8032,9 @@ checksum = "40990edd51aae2c2b6907af74ffb635029d5788228222c4bb811e9351c0caad3"
[[package]]
name = "zmij"
version = "1.0.14"
version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd8f3f50b848df28f887acb68e41201b5aea6bc8a8dacc00fb40635ff9a72fea"
checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65"
[[package]]
name = "zopfli"

View File

@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
edition = "2021"
license = "UNLICENSED"
publish = ["xinu"]
version = "0.17.61"
version = "0.17.60"
repository = "https://git.z.xinu.tv/wathiede/letterbox"
[profile.dev]

View File

@@ -178,36 +178,11 @@ pub fn extract_calendar_metadata_from_mail(
let month = &caps[2];
let day = &caps[3];
let year = &caps[4];
let start_hour: u32 = caps[5].parse().unwrap_or(0);
let start_min: u32 = caps.get(6).map(|m| m.as_str().parse().unwrap_or(0)).unwrap_or(0);
let start_ampm = &caps[7];
let end_hour: u32 = caps[8].parse().unwrap_or(0);
let end_min: u32 = caps.get(9).map(|m| m.as_str().parse().unwrap_or(0)).unwrap_or(0);
let end_ampm = &caps[10];
// Convert 12-hour to 24-hour format
let start_hour_24 = if start_ampm == "pm" && start_hour != 12 {
start_hour + 12
} else if start_ampm == "am" && start_hour == 12 {
0
} else {
start_hour
};
let end_hour_24 = if end_ampm == "pm" && end_hour != 12 {
end_hour + 12
} else if end_ampm == "am" && end_hour == 12 {
0
} else {
end_hour
};
let date_str = format!("{} {} {}", month, day, year);
if let Ok(date) = chrono::NaiveDate::parse_from_str(&date_str, "%b %d %Y") {
// Store date with time in YYYYMMDDTHHMMSS format for start/end
let start_dt = format!("{}T{:02}{:02}00", date.format("%Y%m%d"), start_hour_24, start_min);
let end_dt = format!("{}T{:02}{:02}00", date.format("%Y%m%d"), end_hour_24, end_min);
start_date = Some(start_dt);
end_date = Some(end_dt);
let ymd = date.format("%Y%m%d").to_string();
start_date = Some(ymd.clone());
end_date = Some(ymd);
}
} else {
// Pattern: from Thu Sep 11 to Fri Jan 30, 2026
@@ -400,37 +375,13 @@ pub fn extract_calendar_metadata_from_mail(
let (local_fmt_start, local_fmt_end) = if let (Some(ref start_str), Some(ref end_str)) =
(&start_date, &end_date)
{
// Parse dates - try YYYYMMDDTHHMMSS format first (with time), then YYYYMMDD (date only)
let (start_d, start_time) = if start_str.contains('T') {
let parts: Vec<&str> = start_str.split('T').collect();
let date = NaiveDate::parse_from_str(parts[0], "%Y%m%d").ok();
let time = if parts.len() > 1 {
chrono::NaiveTime::parse_from_str(parts[1], "%H%M%S").ok()
} else {
None
};
(date, time)
} else {
(NaiveDate::parse_from_str(start_str, "%Y%m%d").ok(), None)
};
let (end_d, end_time) = if end_str.contains('T') {
let parts: Vec<&str> = end_str.split('T').collect();
let date = NaiveDate::parse_from_str(parts[0], "%Y%m%d").ok();
let time = if parts.len() > 1 {
chrono::NaiveTime::parse_from_str(parts[1], "%H%M%S").ok()
} else {
None
};
(date, time)
} else {
(NaiveDate::parse_from_str(end_str, "%Y%m%d").ok(), None)
};
// Parse YYYYMMDD format dates
let start_d = NaiveDate::parse_from_str(start_str, "%Y%m%d").ok();
let end_d = NaiveDate::parse_from_str(end_str, "%Y%m%d").ok();
if let (Some(start), Some(end)) = (start_d, end_d) {
// For all-day events (no time), end date is exclusive, so we need to subtract one day
let is_allday = start_time.is_none() && end_time.is_none();
let display_end = if is_allday && end > start {
// For all-day events, end date is exclusive, so we need to subtract one day
let display_end = if end > start {
end.pred_opt().unwrap_or(end)
} else {
end
@@ -447,17 +398,9 @@ pub fn extract_calendar_metadata_from_mail(
}
}
// Format dates for display - include time if available
let fmt_start = if let Some(t) = start_time {
format!("{} {}", start.format("%a %b %e, %Y"), t.format("%-I:%M %p"))
} else {
start.format("%a %b %e, %Y").to_string()
};
let fmt_end = if let Some(t) = end_time {
format!("{} {}", display_end.format("%a %b %e, %Y"), t.format("%-I:%M %p"))
} else {
display_end.format("%a %b %e, %Y").to_string()
};
// Format dates for display
let fmt_start = start.format("%a %b %e, %Y").to_string();
let fmt_end = display_end.format("%a %b %e, %Y").to_string();
(fmt_start, fmt_end)
} else {
(start_val.clone(), end_val.clone())
@@ -2452,9 +2395,9 @@ mod tests {
assert_eq!(meta.summary, Some("Dentist appt".to_string()));
// Organizer: from From header, extract email address
assert_eq!(meta.organizer, Some("tconvertino@gmail.com".to_string()));
// Dates: should extract Sep 23, 2025, 3pm-4pm (15:00-16:00)
assert_eq!(meta.start_date, Some("20250923T150000".to_string()));
assert_eq!(meta.end_date, Some("20250923T160000".to_string()));
// Dates: should extract Sep 23, 2025, 3pm-4pm
assert_eq!(meta.start_date, Some("20250923".to_string()));
assert_eq!(meta.end_date, Some("20250923".to_string()));
// Should not be recurring
if let Some(ref html) = meta.body_html {
assert!(
@@ -2682,17 +2625,13 @@ mod tests {
assert_eq!(meta.summary, Some("painting class".to_string()));
assert_eq!(meta.organizer, Some("tconvertino@gmail.com".to_string()));
// Dates: Thursday Feb 12, 2026 7pm - 9pm (same day event with time)
// Start: 7pm = 19:00, End: 9pm = 21:00
assert_eq!(meta.start_date, Some("20260212T190000".to_string()));
assert_eq!(meta.end_date, Some("20260212T210000".to_string()));
assert_eq!(meta.start_date, Some("20260212".to_string()));
assert_eq!(meta.end_date, Some("20260212".to_string()));
// Assert ical summary is rendered and shows Feb 12 highlighted
let html = meta.body_html.expect("body_html");
println!("Rendered HTML: {}", html);
assert!(html.contains("ical-flex"), "Calendar widget should be rendered");
assert!(html.contains(r#"data-event-day="2026-02-12""#), "Feb 12 should be highlighted");
// Verify time is displayed in the HTML
assert!(html.contains("7:00 PM") || html.contains("7pm") || html.contains("19:00"),
"HTML should contain the start time");
}
#[test]