From fa7df55b0e1f528648c5344e50b11c3f89f30862 Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 10 Dec 2023 17:26:04 -0800 Subject: [PATCH] server: send tags on each message in thread --- server/src/graphql.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/graphql.rs b/server/src/graphql.rs index 6b7dc9e..5566059 100644 --- a/server/src/graphql.rs +++ b/server/src/graphql.rs @@ -67,6 +67,7 @@ pub struct Message { // On disk location of message pub path: String, pub attachments: Vec, + pub tags: Vec, } // Content-Type: image/jpeg; name="PXL_20231125_204826860.jpg" @@ -314,6 +315,12 @@ impl QueryRoot { let mut messages = Vec::new(); for (path, id) in std::iter::zip(nm.files(&thread_id)?, nm.message_ids(&thread_id)?) { info!("{id}\nfile: {path}"); + let msg = nm.show(&format!("id:{id}"))?; + let tags = msg.0[0].0[0] + .0 + .as_ref() + .map(|m| m.tags.clone()) + .unwrap_or_else(Vec::default); let file = File::open(&path)?; let mmap = unsafe { MmapOptions::new().map(&file)? }; let m = parse_mail(&mmap)?; @@ -372,6 +379,7 @@ impl QueryRoot { to, cc, subject, + tags, timestamp, headers, body,