Commit Graph

67 Commits (master)

Author SHA1 Message Date
Manos Pitsidianakis ab04189887
clippy: fix new warnings for 1.78.0
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
4 weeks ago
Manos Pitsidianakis ae96038fbf
Make unicode-segmentation a hard dependency
meli/melib are UTF8 software, so we should have proper Unicode support.

A compile-time env var is added, `UNICODE_REGENERATE_TABLES` to force
network access and rebuild the cached unicode tables.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2 months ago
Manos Pitsidianakis 07072e2e3f
melib/thread: prevent panic if envelope is deleted
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
2 months ago
Manos Pitsidianakis c7aee72525
melib: add clippy::doc_markdown
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
3 months ago
Manos Pitsidianakis 0270db0123
melib: From<&[u8]> -> From<B: AsRef<[u8]>>
This change allows byte literals to be used with the from trait method.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 months ago
Manos Pitsidianakis 808aa4942d
melib: rename text_processing to text for the whole brevity thing
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
5 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 a1e7006186
melib: move Sort{Order,Field} to utils mod
We want to use SortOrder enum for non-thread purposes in the next
commit, so move it out of the thread module.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
9 months ago
Manos Pitsidianakis 5c2b04719b
Normalize std::fmt::* imports 10 months ago
Manos Pitsidianakis 7c7f6e1923
melib/thread: don't increase Thread length for duplicates
If an envelope that was already in the Threads object was inserted,
the only modification would be to erroneously increase the Thread len by
one.
10 months ago
Manos Pitsidianakis bb7e119ade
Add gitea CI workflows 11 months ago
Manos Pitsidianakis d4e605c098
Add tagref source code annotations
Source Code Annotation Tags:

Global tags (in tagref format <https://github.com/stepchowfun/tagref>)
for source code annotation:

- [tag:hardcoded_color_value] Replace hardcoded color values with user
   configurable ones.
- [tag:needs_unit_test]
- [tag:needs_user_doc]
- [tag:needs_dev_doc]
- [tag:FIXME]
- [tag:TODO]
- [tag:VERIFY] Verify whether this is the correct way to do something
- [tag:DEBT] Technical debt
11 months ago
Manos Pitsidianakis 619fbef129
melib/thread: recursively calculate update_show_subject()
Walk the entire thread tree and update show_subject collectively when a
new entry is added.
11 months ago
Manos Pitsidianakis ba7f5dce1c
listing/thread: fix display of threaded conversations tree structure
When missing intermediate and/or parent messages in a thread, the
printed thread tree branches were completely invalid. This commit makes
sure thread node entries that have no corresponding envelopes are
accounted for in the tree structure.
11 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 5699baecfb
melib: add utils::{futures, random} 12 months ago
Manos Pitsidianakis bf615e7d93
melib/thread: check for case when envelope has its own message id in References and In-Reply-To
Emails sent from meli's gitea do this, and it makes them invisible in
thread listings.
1 year ago
Manos Pitsidianakis b1a7188771
Clippy fixes 1 year ago
Manos Pitsidianakis bd22f986f0 melib: fix clippy lints 2 years ago
Manos Pitsidianakis b776409d6c melib/thread.rs: add thread, env hash index fields 2 years ago
Manos Pitsidianakis 16646976d7 compose: fix reply subject prefixes stripping original prefix
Unintelligent heuristic but should cover most cases?

Configurable subject response prefix #142
https://git.meli.delivery/meli/meli/issues/142

Closes #142
2 years ago
Manos Pitsidianakis b138d9bc61 melib: fix some clippy lints 2 years ago
Manos Pitsidianakis 8c7b001aa5 listing/conversations.rs: add `thread_subject_pack` command to pack different inner thread subjects in entry title 2 years ago
Manos Pitsidianakis da9c80ccfd melib: Enhance SubjectPrefix with strip_prefixes_from_list() method
And make it public.
2 years ago
Manos Pitsidianakis 781a1d0e1b
melib/backends: add collection() method to MailBackend
Keep track of the Collection state in the backend side
3 years ago
Manos Pitsidianakis ab0ef1b63c
melib/thread: hash Message-ID for ThreadNodeHash
Make ThreadNodeHash predictable.
3 years ago
Manos Pitsidianakis 9dd21eea50
melib/threads: prefer local ThreadNode env_hash
When inserting an envelope in a thread and its Message-ID already exists
with an associated envelope, overwrite the association if the previous
associated envelope is from a foreign mailbox and current envelope is
not. This happens when mail from a sent folder has been inserted in eg
your INBOX, but somehow INBOX has a copy of your own message as well.
This can happen when mailing lists that send you copies of your own
posts.

The problem with this was that in IMAP your mailing list copy was unseen
and you could not mark it seen because the thread only knew about your
Sent mailbox copy.
4 years ago
Manos Pitsidianakis baa44109f2
melib/thread: "merge" duplicate messages in threads 4 years ago
Manos Pitsidianakis 341ff9164b
melib/notmuch: add Message,TagIterator,Thread types 4 years ago
Manos Pitsidianakis 8c6c9806b5
Fix some clippy lints 4 years ago
Manos Pitsidianakis d1a9f4e28a
melib/collection: remove unnecessary mut references 4 years ago
Manos Pitsidianakis 5ec7c59d8a
melib/threads: re-add to missing_message_ids on remove 4 years ago
Manos Pitsidianakis e1c9967260
melib: Small documentation fixes for smtp, thread 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis eb701695f7
Remove fnv crate 4 years ago
Manos Pitsidianakis a8c1016f37
Add various logic checks 4 years ago
Manos Pitsidianakis 4ac52d9d5b
Replace every use of Folder with Mailbox
Use Mailbox for consistency.
4 years ago
Manos Pitsidianakis 45c0160cb6
Fix ThreadListing
ThreadListing was broken after the ThreadGroup introduction
4 years ago
Manos Pitsidianakis 05b91f1c02
Remove text_processing
Unwrap text_processing into melib

In preparation for uploading meli as a separate crate on crates.io.
4 years ago
Manos Pitsidianakis 5dc477bcd5
Fix some unused etc warnings 4 years ago
Manos Pitsidianakis 254028fa47
melib/threads: fix thread splintering case when inserting reply
When inserting reply, its thread group was re-inserted with the reply as
the root. This is a mistake as threads should never be re-inserted, only
modified.
4 years ago
Manos Pitsidianakis e07b5faf6e
melib/threads: already-exists check in threads insert 4 years ago
Manos Pitsidianakis 350fafb515
melib/thread: add attachments field to Thread 4 years ago
Manos Pitsidianakis 5e68d600b9
melib/threads: Split ThreadGroup::Group to Thread
Create Thread struct.
4 years ago
Manos Pitsidianakis d9269335a1
melib/threads: rename thread hashes
- Rename ThreadHash to ThreadNodeHash
- Rename ThreadGroupHash to ThreadHash
4 years ago
Manos Pitsidianakis 47a69f8eb9
melib: add ThreadGroup
Instead of using Union/Find to gather mail that belongs in the same
e-mail thread together, add a new entity ThreadGroup that ThreadNodes
point to. ThreadGroup represents an actual Thread: A thread root
ThreadGroup::Group or a reply ThreadGroup::Node.

To make semantics more accurate:

- ThreadNode hash should be renamed to ThreadNodeHash
- ThreadGroupHash should be renamed to ThreadHash
- ThreadGroup::Group should be a struct named Thread instead
- move ThreadGroup::Node logic to ThreadNode akin to Union/Find
- rename ThreaddGroup::Group to Thread
4 years ago
Manos Pitsidianakis 1eb49efb22
melib/threads: use all References in thread building
WIP
4 years ago
Manos Pitsidianakis a365a846b8
Replace StackVec with smallvec::SmallVec
SmallVec has a less buggy and better implementation.
4 years ago