Treat email and news posts as distinct types on the frontend and backend
This commit is contained in:
@@ -15,7 +15,7 @@ use crate::{
|
||||
error::ServerError,
|
||||
graphql::{
|
||||
Attachment, Body, DispositionType, Email, EmailThread, Header, Html, Message, PlainText,
|
||||
Tag, ThreadSummary, UnhandledContentType,
|
||||
Tag, Thread, ThreadSummary, UnhandledContentType,
|
||||
},
|
||||
linkify_html, sanitize_html,
|
||||
};
|
||||
@@ -125,7 +125,7 @@ pub async fn thread(
|
||||
nm: &Notmuch,
|
||||
thread_id: String,
|
||||
debug_content_tree: bool,
|
||||
) -> Result<EmailThread, ServerError> {
|
||||
) -> Result<Thread, ServerError> {
|
||||
// TODO(wathiede): normalize all email addresses through an address book with preferred
|
||||
// display names (that default to the most commonly seen name).
|
||||
let mut messages = Vec::new();
|
||||
@@ -246,11 +246,11 @@ pub async fn thread(
|
||||
.next()
|
||||
.and_then(|m| m.subject.clone())
|
||||
.unwrap_or("(NO SUBJECT)".to_string());
|
||||
Ok(EmailThread {
|
||||
Ok(Thread::Email(EmailThread {
|
||||
thread_id,
|
||||
subject,
|
||||
messages,
|
||||
})
|
||||
}))
|
||||
}
|
||||
|
||||
fn email_addresses(
|
||||
|
||||
Reference in New Issue
Block a user