Compare commits

..

No commits in common. "7b22f854294e5c0a1118b87831329bd9cf2cbc49" and "f1b5e789622dcce06a7f0357e8543bf5a7e0c971" have entirely different histories.

5 changed files with 14 additions and 73 deletions

View File

@ -67,7 +67,6 @@ pub struct Message {
// On disk location of message
pub path: String,
pub attachments: Vec<Attachment>,
pub tags: Vec<String>,
}
// Content-Type: image/jpeg; name="PXL_20231125_204826860.jpg"
@ -315,12 +314,6 @@ 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)?;
@ -379,7 +372,6 @@ impl QueryRoot {
to,
cc,
subject,
tags,
timestamp,
headers,
body,

View File

@ -504,30 +504,6 @@
}
}
}
},
{
"args": [],
"deprecationReason": null,
"description": null,
"isDeprecated": false,
"name": "tags",
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "String",
"ofType": null
}
}
}
}
}
],
"inputFields": null,

View File

@ -4,7 +4,6 @@ query ShowThreadQuery($threadId: String!) {
messages {
id
subject
tags
from {
name
addr

View File

@ -12,14 +12,6 @@
.message {
padding: 0.5em;*/
}
.message .headers {
width: 100%;
}
.message .headers .header {
overflow: clip;
text-overflow: ellipsis;
white-space: nowrap;
}
.body {
background: white;
color: black;

View File

@ -1,5 +1,5 @@
use std::{
collections::{hash_map::DefaultHasher, HashSet},
collections::hash_map::DefaultHasher,
hash::{Hash, Hasher},
};
@ -265,33 +265,20 @@ fn raw_text_message(contents: &str) -> Node<Msg> {
fn thread(thread: &ShowThreadQueryThread) -> Node<Msg> {
// TODO(wathiede): show per-message subject if it changes significantly from top-level subject
set_title(&thread.subject);
let mut tags: Vec<_> = thread
.messages
.iter()
.fold(HashSet::new(), |mut tags, msg| {
tags.extend(msg.tags.clone());
tags
})
.into_iter()
.collect();
tags.sort();
let messages = thread.messages.iter().map(|msg| {
div![
C!["message"],
/* TODO(wathiede): collect all the tags and show them here. */
msg.from
.as_ref()
.map(|from| div![C!["header"], "From: ", view_address(&from)]),
msg.timestamp
.map(|ts| div![C!["header"], "Date: ", human_age(ts)]),
div!["Message-ID: ", &msg.id],
div![
C!["headers"],
/* TODO(wathiede): collect all the tags and show them here. */
msg.from
.as_ref()
.map(|from| div![C!["header"], "From: ", view_address(&from)]),
msg.timestamp
.map(|ts| div![C!["header"], "Date: ", human_age(ts)]),
div![C!["header"], "Message-ID: ", &msg.id],
div![
C!["header"],
IF!(!msg.to.is_empty() => span!["To: ", view_addresses(&msg.to)]),
IF!(!msg.cc.is_empty() => span!["CC: ", view_addresses(&msg.cc)])
],
C!["header"],
IF!(!msg.to.is_empty() => span!["To: ", view_addresses(&msg.to)]),
IF!(!msg.cc.is_empty() => span!["CC: ", view_addresses(&msg.cc)])
],
div![
C!["body"],
@ -333,12 +320,7 @@ fn thread(thread: &ShowThreadQueryThread) -> Node<Msg> {
});
div![
C!["thread"],
p![
C!["is-size-4"],
&thread.subject,
" ",
tags_chiclet(&tags, false)
],
p![C!["is-size-4"], &thread.subject],
messages,
/* TODO(wathiede): plumb in orignal id
a![
@ -369,7 +351,7 @@ fn view_content_tree(content_tree: &str) -> Node<Msg> {
})
],
IF!(debug_open.get() =>
pre![C!["content-tree"], content_tree]),
pre![C!["content-tree"], content_tree]),
]
}