server: WIP attachment serving

This commit is contained in:
2023-12-03 09:11:00 -08:00
parent 488c3b86f8
commit f5f9eb175d
2 changed files with 123 additions and 3 deletions

View File

@@ -89,6 +89,22 @@ impl<'r, 'o: 'r> Responder<'r, 'o> for PartResponder {
.ok()
}
}
#[get("/attachment/<id>/<idx>")]
async fn attachment(
nm: &State<Notmuch>,
id: &str,
idx: usize,
) -> Result<PartResponder, Debug<NotmuchError>> {
let mid = if id.starts_with("id:") {
id.to_string()
} else {
format!("id:{}", id)
};
let bytes = Vec::new();
let filename = None;
// TODO(wathiede): use walk_attachments from graphql to fill this out
Ok(PartResponder { bytes, filename })
}
#[get("/original/<id>/part/<part>")]
async fn original_part(