Compare commits
26 Commits
06e65a52b3
...
letterbox-
| Author | SHA1 | Date | |
|---|---|---|---|
| 16e559c1c2 | |||
| 93736b386f | |||
| a632e6e6bc | |||
| 1c0f6d7ed4 | |||
| 51b0b719d3 | |||
| 2c6fee0fba | |||
| d33e9b87b2 | |||
| 02d5c7372c | |||
| d51bcd81ed | |||
| 4d9dc31f3b | |||
| fba91293d9 | |||
| e1be683d73 | |||
| c94b9f088a | |||
| 663298d650 | |||
| 23e4d3b968 | |||
| f82fc5dc77 | |||
| 2830c238fd | |||
| 6cebb0e7d5 | |||
| 1837b5ef01 | |||
| 48bf8ba81f | |||
| 645d008278 | |||
| 0b94f482c7 | |||
| 067b480856 | |||
| 89cb1e4e75 | |||
| 46021c5d2c | |||
| 4243f7b77d |
416
Cargo.lock
generated
416
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@ authors = ["Bill Thiede <git@xinu.tv>"]
|
||||
edition = "2021"
|
||||
license = "UNLICENSED"
|
||||
publish = ["xinu"]
|
||||
version = "0.17.38"
|
||||
version = "0.17.41"
|
||||
repository = "https://git.z.xinu.tv/wathiede/letterbox"
|
||||
|
||||
[profile.dev]
|
||||
|
||||
@@ -32,8 +32,8 @@ futures = "0.3.31"
|
||||
headers = "0.4.0"
|
||||
html-escape = "0.2.13"
|
||||
ical = "0.11"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.38", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared", version = "0.17.38", registry = "xinu" }
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.41", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared", version = "0.17.41", registry = "xinu" }
|
||||
linkify = "0.10.0"
|
||||
lol_html = "2.3.0"
|
||||
mailparse = "0.16.1"
|
||||
|
||||
@@ -1,3 +1,60 @@
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use askama::Template;
|
||||
use chrono::{Datelike, Local, LocalResult, TimeZone, Utc};
|
||||
use chrono_tz::Tz;
|
||||
use mailparse::{parse_content_type, parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
||||
use quick_xml::de::from_str as xml_from_str;
|
||||
use tracing::{error, info, warn};
|
||||
use zip::ZipArchive;
|
||||
|
||||
use crate::{
|
||||
error::ServerError,
|
||||
graphql::{Attachment, Body, DispositionType, Email, Html, PlainText, UnhandledContentType},
|
||||
linkify_html,
|
||||
};
|
||||
|
||||
const APPLICATION_GZIP: &'static str = "application/gzip";
|
||||
|
||||
const APPLICATION_ZIP: &'static str = "application/zip";
|
||||
const IMAGE_JPEG: &'static str = "image/jpeg";
|
||||
const IMAGE_PJPEG: &'static str = "image/pjpeg";
|
||||
const IMAGE_PNG: &'static str = "image/png";
|
||||
const MESSAGE_RFC822: &'static str = "message/rfc822";
|
||||
const MULTIPART_ALTERNATIVE: &'static str = "multipart/alternative";
|
||||
const MULTIPART_MIXED: &'static str = "multipart/mixed";
|
||||
const MULTIPART_RELATED: &'static str = "multipart/related";
|
||||
const MULTIPART_REPORT: &'static str = "multipart/report";
|
||||
const TEXT_CALENDAR: &'static str = "text/calendar";
|
||||
const TEXT_HTML: &'static str = "text/html";
|
||||
const TEXT_PLAIN: &'static str = "text/plain";
|
||||
|
||||
// Inline Askama filters module for template use
|
||||
mod filters {
|
||||
// Usage: {{ items|batch(7) }}
|
||||
pub fn batch<T: Clone>(
|
||||
items: &[T],
|
||||
_: &dyn ::askama::Values,
|
||||
size: usize,
|
||||
) -> askama::Result<Vec<Vec<T>>> {
|
||||
if size == 0 {
|
||||
return Ok(vec![]);
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
let mut chunk = Vec::with_capacity(size);
|
||||
for item in items {
|
||||
chunk.push(item.clone());
|
||||
if chunk.len() == size {
|
||||
out.push(chunk);
|
||||
chunk = Vec::with_capacity(size);
|
||||
}
|
||||
}
|
||||
if !chunk.is_empty() {
|
||||
out.push(chunk);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
}
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct ExtractedCalendarMetadata {
|
||||
pub is_google_calendar_event: bool,
|
||||
@@ -443,72 +500,6 @@ pub fn extract_calendar_metadata_from_mail(
|
||||
body_html,
|
||||
}
|
||||
}
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct ExtractedCalendarMetadata {
|
||||
pub is_google_calendar_event: bool,
|
||||
pub summary: Option<String>,
|
||||
pub organizer: Option<String>,
|
||||
pub start_date: Option<String>,
|
||||
pub end_date: Option<String>,
|
||||
pub body_html: Option<String>,
|
||||
}
|
||||
// Inline Askama filters module for template use
|
||||
mod filters {
|
||||
// Usage: {{ items|batch(7) }}
|
||||
pub fn batch<T: Clone>(
|
||||
items: &[T],
|
||||
_: &dyn ::askama::Values,
|
||||
size: usize,
|
||||
) -> askama::Result<Vec<Vec<T>>> {
|
||||
if size == 0 {
|
||||
return Ok(vec![]);
|
||||
}
|
||||
let mut out = Vec::new();
|
||||
let mut chunk = Vec::with_capacity(size);
|
||||
for item in items {
|
||||
chunk.push(item.clone());
|
||||
if chunk.len() == size {
|
||||
out.push(chunk);
|
||||
chunk = Vec::with_capacity(size);
|
||||
}
|
||||
}
|
||||
if !chunk.is_empty() {
|
||||
out.push(chunk);
|
||||
}
|
||||
Ok(out)
|
||||
}
|
||||
}
|
||||
use std::io::{Cursor, Read};
|
||||
|
||||
use askama::Template;
|
||||
use chrono::{Datelike, Local, LocalResult, TimeZone, Utc};
|
||||
use chrono_tz::Tz;
|
||||
use mailparse::{parse_content_type, parse_mail, MailHeader, MailHeaderMap, ParsedMail};
|
||||
use quick_xml::de::from_str as xml_from_str;
|
||||
use tracing::{error, info, warn};
|
||||
use zip::ZipArchive;
|
||||
|
||||
use crate::{
|
||||
error::ServerError,
|
||||
graphql::{Attachment, Body, DispositionType, Email, Html, PlainText, UnhandledContentType},
|
||||
linkify_html,
|
||||
};
|
||||
|
||||
const APPLICATION_GZIP: &'static str = "application/gzip";
|
||||
|
||||
const APPLICATION_ZIP: &'static str = "application/zip";
|
||||
const IMAGE_JPEG: &'static str = "image/jpeg";
|
||||
const IMAGE_PJPEG: &'static str = "image/pjpeg";
|
||||
const IMAGE_PNG: &'static str = "image/png";
|
||||
const MESSAGE_RFC822: &'static str = "message/rfc822";
|
||||
const MULTIPART_ALTERNATIVE: &'static str = "multipart/alternative";
|
||||
const MULTIPART_MIXED: &'static str = "multipart/mixed";
|
||||
const MULTIPART_RELATED: &'static str = "multipart/related";
|
||||
const MULTIPART_REPORT: &'static str = "multipart/report";
|
||||
const TEXT_CALENDAR: &'static str = "text/calendar";
|
||||
const TEXT_HTML: &'static str = "text/html";
|
||||
const TEXT_PLAIN: &'static str = "text/plain";
|
||||
|
||||
pub fn email_addresses(
|
||||
_path: &str,
|
||||
m: &ParsedMail,
|
||||
|
||||
@@ -12,7 +12,7 @@ version.workspace = true
|
||||
|
||||
[dependencies]
|
||||
build-info = "0.0.41"
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.38", registry = "xinu" }
|
||||
letterbox-notmuch = { path = "../notmuch", version = "0.17.41", registry = "xinu" }
|
||||
regex = "1.11.1"
|
||||
serde = { version = "1.0.219", features = ["derive"] }
|
||||
sqlx = "0.8.5"
|
||||
|
||||
@@ -33,7 +33,7 @@ wasm-bindgen = "=0.2.100"
|
||||
uuid = { version = "1.16.0", features = [
|
||||
"js",
|
||||
] } # direct dep to set js feature, prevents Rng issues
|
||||
letterbox-shared = { path = "../shared/", version = "0.17.38", registry = "xinu" }
|
||||
letterbox-shared = { path = "../shared/", version = "0.17.41", registry = "xinu" }
|
||||
seed_hooks = { version = "0.4.1", registry = "xinu" }
|
||||
strum_macros = "0.27.1"
|
||||
gloo-console = "0.3.0"
|
||||
|
||||
Reference in New Issue
Block a user