crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit 7763dbe7b90984fdd21e1fe941c91de32321251f
parent a7b5be407af9ae61122ea2b264b513a80f5e612b
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun, 27 Mar 2022 12:01:14 -0700

more

Diffstat:
MTODO | 10+++++-----
Msrc/templates/html.rs | 2+-
Msrc/threading.rs | 5++++-
3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/TODO b/TODO @@ -1,13 +1,13 @@ TODO ==== atom get item href working on list -fix bottom anchor +fix bottom anchor/ latest link +check for html escape bugz more thoroughly? +URL encode spaces in links for gemini export -check for html escape bugz +later +---- Duplicate ID verification: warn on duplicate ID, use first received-date. This is to prevent someone overwriting old emails secretly - --- -URL encode spaces in links for gemini export reference mblaze command, add examples to readme fix docs Color highlight on anchor select diff --git a/src/templates/html.rs b/src/templates/html.rs @@ -101,7 +101,7 @@ impl List { ), ("subject", &x(&thread.message.subject)), ("replies", &thread.reply_count.to_string()), - ("date", &x(&Date::from(thread.last_reply).ymd())), + ("date", &Date::from(thread.last_reply).ymd()), ( "from", &x(&thread. // awkawrd diff --git a/src/threading.rs b/src/threading.rs @@ -34,7 +34,10 @@ impl ThreadIdx { // TODO should be format agnostic (use internal representation of email) pub fn add_email(&mut self, msg: &Message, path: PathBuf) { let msg_id = msg.get_message_id().unwrap(); // TODO unwrap - // TODO handle duplicate id case + if self.id_index.get(msg_id).is_some() { + // TODO handle duplicate id case + panic!("duplicate msg id found") + } let t = msg .get_received() .as_datetime_ref()