From 220008d0b4e21d87b6d4dc7f98d1104c405e2ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20DOUIN?= Date: Mon, 15 Apr 2024 14:29:30 +0200 Subject: [PATCH] fix in reply to header skipped from mailto url --- CHANGELOG.md | 2 ++ src/email/message/command/mailto.rs | 21 ++++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 350c62d..4ba376b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed watch IMAP envelopes when folder was empty [#179]. - Prevented parsing of undefined config options [#188]. +- Fixed `In-Reply-To` header being skipped from mailto URLs [#194]. ## [1.0.0-beta.3] - 2024-02-25 @@ -814,3 +815,4 @@ Few major concepts changed: [#173]: https://todo.sr.ht/~soywod/pimalaya/173 [#184]: https://todo.sr.ht/~soywod/pimalaya/184 [#188]: https://todo.sr.ht/~soywod/pimalaya/188 +[#194]: https://todo.sr.ht/~soywod/pimalaya/194 diff --git a/src/email/message/command/mailto.rs b/src/email/message/command/mailto.rs index e855a73..540aa2f 100644 --- a/src/email/message/command/mailto.rs +++ b/src/email/message/command/mailto.rs @@ -69,11 +69,22 @@ impl MessageMailtoCommand { let mut body = String::new(); for (key, val) in self.url.query_pairs() { - match key.to_lowercase().as_bytes() { - b"cc" => builder = builder.cc(val.to_string()), - b"bcc" => builder = builder.bcc(val.to_string()), - b"subject" => builder = builder.subject(val), - b"body" => body += &val, + match key { + key if key.eq_ignore_ascii_case("in-reply-to") => { + builder = builder.in_reply_to(val.to_string()); + } + key if key.eq_ignore_ascii_case("cc") => { + builder = builder.cc(val.to_string()); + } + key if key.eq_ignore_ascii_case("bcc") => { + builder = builder.bcc(val.to_string()); + } + key if key.eq_ignore_ascii_case("subject") => { + builder = builder.subject(val.to_string()); + } + key if key.eq_ignore_ascii_case("body") => { + body += &val; + } _ => (), } }