Commit Graph

16 Commits (303c530488a4d5912bec22b6df69496426fe7884)

Author SHA1 Message Date
Manos Pitsidianakis 303c530488
Load libnotmuch dynamically 2020-02-26 14:18:00 +02:00
Manos Pitsidianakis 4ac52d9d5b
Replace every use of Folder with Mailbox
Use Mailbox for consistency.
2020-02-26 10:54:10 +02:00
Manos Pitsidianakis a365a846b8
Replace StackVec with smallvec::SmallVec
SmallVec has a less buggy and better implementation.
2020-01-20 15:58:59 +02:00
Manos Pitsidianakis 3d84f3b9ad
notmuch: remove needless clones 2020-01-02 00:05:36 +02:00
Manos Pitsidianakis 2b6f6ab42c
melib: Add BackendFolder methods, move special usage logic to backend
- add count() method to return (unseen, total) counts
- add is_subscribed()
- add set_special_usage() and set_is_subscribed()

concerns #8
2019-12-18 08:58:49 +02:00
Manos Pitsidianakis 2e38ea11e2
melib: make MailBackend::is_online() return Result<()>
Return Result<()> instead of bool to indicate connection status in order
to be able to show errors to user.
2019-12-14 18:57:52 +02:00
Manos Pitsidianakis 6f76cd9acc
melib: add special_usage() method to BackendFolder
Eventually after loading potential usage values from configuration,
backends will be able to change the usage values themselves. IMAP and
JMAP have the ability to set Mailbox roles (IMAP needs LIST-SPECIAL
extension
2019-12-11 00:15:36 +02:00
Manos Pitsidianakis 0eaf17871a
melib: add set_tags command in BackendOp 2019-12-08 11:25:54 +02:00
Manos Pitsidianakis 9d8d3e09f4
melib: remove unused methods from BackendOp 2019-12-06 12:33:58 +02:00
Manos Pitsidianakis 258b6c8fe8
melib: add tags() method in MailBackend
Add tags() method that returns Option<Arc<RwLock<BTreeMap<u64, String>>>>.

The BTreeMap holds available tags in a mail backend and uses the tag's
hash as key.

The method returns an Option because not all backends may support
tagging.
2019-11-30 17:37:00 +02:00
Manos Pitsidianakis 6653357d54
melib/notmuch: fix compilation errors 2019-11-30 01:12:14 +02:00
Manos Pitsidianakis 58209d6f6b
Replace some panics with errors 2019-11-27 17:42:11 +02:00
Manos Pitsidianakis ba52c59859
bin: add backend specific validation functions for --test-config flag 2019-11-27 17:42:11 +02:00
Manos Pitsidianakis 41a678c6ef
melib: make MailBackend::folders return Result
Change folders() signature:
-    fn folders(&self) -> FnvHashMap<FolderHash, Folder>;
+    fn folders(&self) -> Result<FnvHashMap<FolderHash, Folder>>;

Imap may not be online, therefore we need the ability to return an
error.
2019-11-23 17:47:24 +02:00
Manos Pitsidianakis 321be8555f
Cleanup startup error exit paths
Make startup methods return Results so that the main binary can exit
cleanly instead of using std::process::exit from arbitrary positions,
which exits the process immediately and doesn't run destructors.
2019-11-16 00:33:22 +02:00
Manos Pitsidianakis 77936e0cd5
melib: add notmuch backend
Missing:
- Watching for updates functionality
- Using tags
- Search
2019-11-15 22:56:45 +02:00