Commit Graph

15 Commits (c7aee7252587d2e42ca5df4a65731e183f7edaf2)

Author SHA1 Message Date
Manos Pitsidianakis c7aee72525
melib: add clippy::doc_markdown
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
3 months ago
Manos Pitsidianakis f900dbea46
Use cargo-derivefmt to sort derives alphabetically
Used https://github.com/dcchut/cargo-derivefmt

With command:

cargo install --locked \
--git https://github.com/dcchut/cargo-derivefmt \
--bin cargo-derivefmt \
--rev 2ff93de7fb418180458dd1ba27e5655607c23ab6

Since it's not on crates.io at the moment.

Sample diff:

  -#[derive(Debug, Deserialize, Clone, Serialize)]
  +#[derive(Clone, Debug, Deserialize, Serialize)]

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
6 months ago
Manos Pitsidianakis 2dc2940586
melib/build.rs: add feature to use cache instead of downloading unicode data
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 946309c6f3
melib: do some small parser refactoring
- Use HeaderName in parsers instead of raw byte strings.
- Use byte literal constants where appropriate instead of repeating
  &b"___"[..]

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 66c21ab173
melib/email: move StandardHeader to its own module
Extract StandardHeader code to its own module to reduce name.rs
line-count size.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 5f29faa640
melib: clippy lint fixes 11 months ago
Manos Pitsidianakis f98e36cee5
melib: Replace old-style /*! module doc comments with //! 11 months ago
Manos Pitsidianakis 6388bea9a0 melib/email/headers: fix &[u8] index in HeaderMap 1 year ago
Manos Pitsidianakis aebff3d3d9 melib: implement mailto RFC properly
This allows mailto links with `In-Reply-To` parameters to work properly.

PS Mailto links can be used with the `mailto MAILTO_URI` command
1 year ago
Manos Pitsidianakis 235fceaf21 melib: Add standard heeder constants in email::headers
Like `http` crate does
1 year ago
Manos Pitsidianakis 8c671935f9
Add compose (pre-submission) hooks for validation/linting
compose-hooks run before submitting an e-mail.
They perform draft validation and/or transformations.
If a hook encounters an error or warning, it will show up as a notification.
The currently available hooks are:
- past-date-warn
  Warn if Date header value is far in the past or future.
- important-header-warn
  Warn if important headers (From, Date, To, Cc, Bcc) are missing or invalid.
- missing-attachment-warn
  Warn if Subject, draft body mention attachments but they are missing.
- empty-draft-warn
  Warn if draft has no subject and no body.

They can be disabled with [composing.disabled_compose_hooks] setting.
1 year ago
Manos Pitsidianakis b1a7188771
Clippy fixes 1 year ago
Manos Pitsidianakis 5634f95553 Rename MeliError struct to Error 2 years ago
Manos Pitsidianakis e407b1e224
melib: add README.md and email module doco 4 years ago
Manos Pitsidianakis 8d50e83a33
melib/email: add case-insensitive Header struct
- HeaderName is either 32 or less inlined bytes or heap-allocated vec for more than that.
- Equality and hashing is case-insensitive
- A HeaderMap is a hashmap from HeaderName to Strings that can be
indexed with &str, case insensitive. Insertion order is also preserved
4 years ago