Commit Graph

805 Commits

Author SHA1 Message Date
Manos Pitsidianakis
7bd2b6932d
Fix meli.conf.5 typo and formatting 2019-12-16 00:14:55 +02:00
Manos Pitsidianakis
8f63572584
Small refactors to avoid implicit unwrap() panics 2019-12-15 19:47:42 +02:00
Manos Pitsidianakis
0201241786
melib/backends: MailBackend::refresh() returns Result
Handle cases were refresh() would fail properly. Fixes a crash reported in #13
2019-12-15 08:55:08 +02:00
Manos Pitsidianakis
17a0f31b3e
ui/accounts: split StartupCheck event semantics
UIEvent::StartupCheck was meant to notify the UI that a folder had made
progress and polling its async worker would return a
Result<Vec<Envelope>>. However the StartupCheck was received by
MailListing components which called account.status() which did the
polling. That means that if the polling got back results, the listing
would have to call account.status() again to show them. This is a
problem in configurations with only one account because there aren't any
other sources of event to force the listing to recheck account.status()

A new event UIEvent::WorkerProgress will do the job of notifying an
Account to poll its workers and the account will send a startupcheck if
it has made progress. That way the refresh progress is as follows:

Worker thread sends WorkerProgress event -> State calls appropriate
account's account.status() method -> account polls workers, and if there
are new results send StartupCheck events -> State passes StartupCheck
events to components -> Listings update themselves when they receive the
event
2019-12-14 19:56:43 +02:00
Manos Pitsidianakis
65efb23f14
melib/MailBackend: add refresh() method
Initiate refresh manually.
2019-12-14 18:58:59 +02:00
Manos Pitsidianakis
d2b4057b7b
melib/MailBackend: add connect() method 2019-12-14 18:58:55 +02:00
Manos Pitsidianakis
10368612ab
ui/listing: prevent spinning on is_online check
Since self.component is never drawn if account is not online, it will
remain dirty and everything will be redrawn again and again, blocking
the UI.
2019-12-14 18:57:58 +02:00
Manos Pitsidianakis
ab3e01359a
ui/Component: change set_dirty() to set_dirty(value)
Next commit will need to set a child component as not dirty so we need
set_dirty(value) instead of set_dirty() that always sets is to true.
2019-12-14 18:57:58 +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
18a8d22b85
ui/shortcuts: Replace arrow key use with configurable shortcuts 2019-12-14 14:16:12 +02:00
Manos Pitsidianakis
41a4de394a
Add optional 'jmap' feature in binary Cargo.toml. 2019-12-13 00:39:56 +02:00
Manos Pitsidianakis
2ed9ffb145
melib/jmap: construct session resource url from user settings 2019-12-13 00:36:26 +02:00
Manos Pitsidianakis
b3cf45b457
Update manpages for JMAP 2019-12-13 00:13:54 +02:00
Manos Pitsidianakis
da8cd4e85f
Remove jmap from default features 2019-12-13 00:07:06 +02:00
Manos Pitsidianakis
8465864dc0
Merge branch 'jmap' 2019-12-13 00:05:31 +02:00
Manos Pitsidianakis
14eb99f515
JMAP WIP #7 2019-12-13 00:04:59 +02:00
Manos Pitsidianakis
d44a453aed
jmap: add keyword->tag support 2019-12-13 00:04:59 +02:00
Manos Pitsidianakis
aa9a6a3128
melib: add SpecialUseMailbox::detect_usage method 2019-12-13 00:04:59 +02:00
Manos Pitsidianakis
30e9114d9c
jmap: fix warnings 2019-12-13 00:04:59 +02:00
Manos Pitsidianakis
d69be5bb0b
ui/accounts: don't panic if Backend::folders is_err 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
275c9f421f
JMAP WIP #6 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
791033d2fc
melib/jmap: add byte operations 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
a41dc6c38a
JMAP WIP #5 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
1ee8ef7a05
JMAP WIP #4 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
a1efeed343
JMAP WIP #3 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
e8611cca2f
JMAP WIP #2 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
a43f6919cc
JMAP WIP 2019-12-13 00:04:58 +02:00
Manos Pitsidianakis
328b17a995
ui/CompactListing: use Segment Trees to calculate max page column width
Given a range of entries that occupy a page (eg [0, 50] for a page of 50
rows high) get the max entry width for this column by using maximum
range queries with segment trees.
2019-12-12 11:11:32 +02:00
Manos Pitsidianakis
7432be5aaa
ui/listings: truncate subject at 150 grapheme width
Large subjects would cause large CellBuffer allocations.
2019-12-12 11:07:54 +02:00
Manos Pitsidianakis
b401b64f35
ui/CellBuffer: change row_iter() bounds to Range
Writing a range x..y is more ergonomic than (x, y+ 1)
2019-12-12 11:04:14 +02:00
Manos Pitsidianakis
651fda1467
text_processing: use grapheme length in Truncate 2019-12-12 11:01:13 +02:00
Manos Pitsidianakis
d9b568cfb4
melib/envelope: decode other_headers values 2019-12-12 11:00:50 +02:00
Manos Pitsidianakis
59f7f03d64
ui: refactor watch thread spawning procedure
- Remove unnecessary parameters from watch(), reload()
- Add NewThread event that adds new threads in
work_controller.static_threads hashmap
- removed obsolete field State.threads
- silence watch thread error notifications
2019-12-12 01:04:33 +02:00
Manos Pitsidianakis
7732b851e6
melib: fix minor header parsing errors
- set_subject checked if last byte was control character instead of last
character. Characters can be multi-byte, duh.
- email::parser::date didn't provide for Date values that had -0000
instead of +0000 (that's a chrono requirement/bug)
2019-12-12 00:44:47 +02:00
Manos Pitsidianakis
81c70b0136
melib: small test cosmetic fixes 2019-12-11 16:07:08 +02:00
Manos Pitsidianakis
e79d9aa1c2
melib/parser: parse quote-printable CRLF soft breaks
Check for CRLF soft breaks after checking for LF ones
2019-12-11 15:10:59 +02:00
Manos Pitsidianakis
b93154a596
ui/MailListings: fix set_seen action not being processed 2019-12-11 01:58:35 +02:00
Manos Pitsidianakis
9fae0f2fa3
melib/imap: prevent minor blocking cases 2019-12-11 01:36:04 +02:00
Manos Pitsidianakis
f05a4205f7
melib/ui: small fixes
- melib/imap: accept quoted strings with escaped quotes in
protocol_parser
- ui/accounts: return unavailabity correctly if folder's worker slot is
empty instead of judging only by its vacancy
- ui/MailView: set view as not dirty if envelope loading from backend
fails so that it stops requesting it in every subsequent redraw
2019-12-11 00:17:11 +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
bce97d71bb
testing/imap_conn: update imapconn shell use 2019-12-11 00:07:47 +02:00
Manos Pitsidianakis
504b658f68
melib/imap: add UidFetchResponse struct and parser
Add handwritten parser for UID FETCH responses and use it for all UID
FETCH calls.
2019-12-11 00:05:41 +02:00
Manos Pitsidianakis
569127fac5
melib/imap: detect untagged CAPABILITY responses
Gmail sends an untagged CAPABILITY response before accepting login, so
be smarter when logging in
2019-12-11 00:01:22 +02:00
Manos Pitsidianakis
8235af9237
melib/imap: quote mailbox names on SELECT/EXAMINE 2019-12-10 23:56:25 +02:00
Manos Pitsidianakis
a20e08eb43
imap: treat \NoSelect mailboxes as empty
\NoSelect are mailboxes that can't be selected, thus treat them as if
they are empty.
2019-12-10 23:54:19 +02:00
Manos Pitsidianakis
ad7c91bc29
ui/sqlite3: warn user if db hasn't been initialised 2019-12-09 20:30:37 +02:00
Manos Pitsidianakis
f3a7fa6350
Bump rustc requirement to 1.39 2019-12-09 18:55:08 +02:00
Manos Pitsidianakis
70357328ea
Fix typos in Makefile 2019-12-09 18:33:46 +02:00
Manos Pitsidianakis
40e928dad3
Push version to 0.4.1 2019-12-08 11:36:38 +02:00
Manos Pitsidianakis
a130871ff1
Add documentation for tags 2019-12-08 11:26:15 +02:00