Commit Graph

36 Commits (master)

Author SHA1 Message Date
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 5f29faa640
melib: clippy lint fixes 12 months ago
Manos Pitsidianakis 4da5366959
Remove bincode dep, use serde_json for sqlite3 values 1 year ago
Manos Pitsidianakis b1a7188771
Clippy fixes 1 year ago
Manos Pitsidianakis 259aeb0087 Convert {Account,Mailbox}Hash from typedef to wrapper struct 2 years ago
Manos Pitsidianakis 56fc43bcf8 melib: add As{Ref,Mut} impls for RwRef{,Mut} 2 years ago
Manos Pitsidianakis 7e09b1807f melib/collection: replace _Ref deref unwraps with expect() 2 years ago
Manos Pitsidianakis 3bc187c570
melib/collections: add RwRef{,Mut} structs 3 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 a34f0aac5b
melib: fix bincode serialization
Previous commit changed bincode deserializes in maildir and sqlite3.rs
from bincode::deserialize_from to using bincode::config::DefaultOptions
and bincode::Options trait's method deserialize_from.

However, these two different deserializes use a different default
settings: https://github.com/servo/bincode/issues/348

Specifically, varint encoding for integers is the default for
DefaultOptions but not when using bincode::{de,}serialize_* functions.
That means that serialized structs were not able to be deserialized.
This commit makes all {de,}serializations use the DefaultOptions
interface rather than the top level functions.
4 years ago
Manos Pitsidianakis d1a9f4e28a
melib/collection: remove unnecessary mut references 4 years ago
Manos Pitsidianakis 3ac2c12e7a
Small fixes 4 years ago
Manos Pitsidianakis 99fbac3806
Remove unused variables/functions 4 years ago
Manos Pitsidianakis 0882dbbad0
melib/Collection: put all fields behind a mutex 4 years ago
Manos Pitsidianakis 1112ef4717
melib/Collection: remove unused fields 4 years ago
Manos Pitsidianakis a7e177586a
Fix clippy lints 4 years ago
Manos Pitsidianakis eca1921a8a
collection: add update_flags() method
On NewFlags events, the threads in Collection were not being updated, so
if an envelope's seen status was toggled the thread's unseen count was
  not updated, and thus not reflected in the UI even though the
  envelope's new flags event was registered properly.
4 years ago
Manos Pitsidianakis ca9d4fde58
Discard EnvelopeRename event if envelope is missing from Collection 4 years ago
Manos Pitsidianakis eb701695f7
Remove fnv crate 4 years ago
Manos Pitsidianakis a8c1016f37
Add various logic checks 4 years ago
Manos Pitsidianakis 651dda67cf
Respect autoload mailbox setting 4 years ago
Manos Pitsidianakis 4ac52d9d5b
Replace every use of Folder with Mailbox
Use Mailbox for consistency.
4 years ago
Manos Pitsidianakis f38d03e43a
melib: {create,delete}_folder returns updated folders
Potential parent folders will have their children fields updated, so
just return all folders.
4 years ago
Manos Pitsidianakis b6efb14824
melib: remove Mailbox
Refactor Collection from melib to hold what folders have what envelopes.

Frontend accounts will now have a FolderEntry for each logical folder
and will unify many Account fields into one and eliminate a lot of
duplicate/dead code.
4 years ago
Manos Pitsidianakis 6a096dd405
Add missing copyright preambles 4 years ago
Manos Pitsidianakis a365a846b8
Replace StackVec with smallvec::SmallVec
SmallVec has a less buggy and better implementation.
4 years ago
Manos Pitsidianakis af365fa8d4
Set 600 perm mode to all created files
When creating a data file, set permissions to read/write for the user.
5 years ago
Manos Pitsidianakis 7463248da8
melib: change BackendOp::set_flag() signature 5 years ago
Manos Pitsidianakis 78eecbb104
melib: Hide Envelope behind RwLock
Envelope can now only be accessed from within a RwLock. Two new structs
are introduced: EnvelopeRef and EnvelopeRefMut. These hold a reference
to an Envelope and the mutex guard that keeps them alive.

This change allows sharing of the envelopes hash map amongst threads.
5 years ago
Manos Pitsidianakis 817c338a13
melib: fix metadata updates in Envelope updates 5 years ago
Manos Pitsidianakis 3f7d962abd
melib: remove ThreadTree, use ThreadNodes for root_set
Remove ThreadTree index in Threads {} struct. Keep a Vec<ThreadHash> for
root_set state of mailbox instead of rebuilding ThreadTrees every
time.
5 years ago
Manos Pitsidianakis bc7da4610e
Send MailboxUpdate events when threads are updated
Depending on the insertion order of folders which is non-deterministic
because it relies on the kernel's scheduling of parsing threads, the
listing the user sees might not be up-to-date because later thread
updates are never broadcast. This results in inconsistencies between
threads and mail listings when a thread's root envelope was part of a
not broadcast update leading to `key not found` panics in a listing's
hashmaps.
5 years ago
Manos Pitsidianakis 8a0e702127
melib,ui: add MailboxEntry enum
Use an enum to describe a mailbox's state in ui::conf::Account instead
of Result.
5 years ago
Manos Pitsidianakis a655a85b5f
ui: fix replies not being synced and inserted properly on RefreshEvents 5 years ago
Manos Pitsidianakis 24831b3c13
Fix warnings, lints, and 2018 errors 5 years ago
Manos Pitsidianakis c6674a294d
melib: unwrap mailbox module 5 years ago