1. spawn thread to send ThreadPulses to the main event loop that "parks" until unparked from State
2. State unparks thread if there are accounts that are offline
3. thread sends ThreadPulse and parks again
4. State checks accounts again and so on.
Move GlobMatch trait from ui::mailcap to text_processing in order to use
it for glob matching folder paths in subscribed_folders field of
account configuration. See next commit.
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.
meli --test-config PATH tests a configuration file for syntax issues or missing options.
Caveat: right now undefined options/values do not return an error.
Backend specific options are also not validated.
- Unflatten shortcuts configuration table.
Shortcuts now have to be defined in levels:
[shortcuts.general]
...
[shortcuts.pager]
...
- Add shortcuts for thread view
- Sort alphabetically in help view
- Parse List-Post value like List-Unsubscribe: comma separated angle bracket limited list of <mailto:> or <url> values
- Check if List-Archive value is angle bracket delimited
Change line_break parameter from bool flag (whether to break in the end
of a line or not) to an Option<usize>, where the value is the x_offset
of the left side of the area. Thus if line_break == Some(_) when a line
ends its value is set as x to continue in the next line properly.
reply and edit actions where only in view/thread.rs, so simple envelope
views had no way to reply. view.rs is used standalone or within
view/thread.rs so it is the appropriate place for the actions.
thread_group property of ThreadNode doesn't yet reflect the actual root
ThreadNode (the root of the thread, that is). So find the root manually
instead.
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.
Prepend a cursor movement (Up/Down/PageUp/PageDown) with a multiplier
(e.g 23+Down, that is '2' then '3' then 'Down') to increase the
movement's length.
Account::is_online(&mut self) should be called from ui/src/state.rs
only, since it launches the watcher threads when an account goes from
offline to online. If it's called from elsewhere the watcher threads
might not get launched ever.
Context needs to know when an account gets online in order to get the
mailbox hashes and launch the watcher threads for this account. Instead
of assuming all accounts are online when launching meli, move the
initialisation logic to an is_online() method on Context to do it on
demand.
The is_online() method is then called by ui::components::mail::Listing
everytime it's drawn to check for status changes.
Some events are invalid when there are no messages shown in the listing.
Instead of checking for self.length > 0 in each of these events, put
them together in an if block.
Errors were not shown properly because the data_columns grids were being
overwritten by redraw_list(). Call redraw_list() only if filtering was
succesful.
The backend object stores the state of the backend associated with an
account.
Hide the backend object between a mutex, in order to be able to share it
with threads in the next commit.
The operation() method on the MailBackend trait returns a trait object
that can read or modify an Envelope directly from the backend. This is
used to get eg the envelope's text, or set flags. It has two arguments,
envelope hash and folder hash.
Only the Maildir backend needed the latter argument, and it can be replaced with a dictionary to match envelope hashes to folder hashes within the Maildir backend.
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.
Add configuration option to embed editor in the composing tab instead of
executing and waiting for it.
Set embed = true in Composing section of your configuration to activate.
Emulate a terminal within meli. In the next commit it will be used to
embed an editor in the composing tab.
This is a non-complete xterm emulation that has some bugs.
Add a boolean field to accounts that states if the account can be
accessed. Local backends (Maildir/mbox) return true every time, but
remote backends (IMAP) may not. Accounts start as offline and then get
initialised when their status goes to online. Right now if an IMAP
account startup but later get offline, there are crashes. With this
change the account can be switched back to offline when that happens.
If the user gives a configuration value in an `[account]` sections that
isn't hard-coded, it gets filed up under the
`extra: HashMap<String, String>` field of `FileAccount`. If the setting
is something that isn't a string like key = true, the parsing will fail
since it expects string values. We want to accept key = true as well as
key = "true".