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.
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.
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.
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.
Use xterm window title escape sequences to set window title when
launched and restoring the previous one when exiting. If option is
blank, no title setting occurs.
Check for pending events in the main process by receiving a timer event
every 300ms. This way loaded folders or received emails will get
recognized even if the appropriate informing signals got lost.
Send an update event even if user's configuration has turned off
notification for this special event. This happens if the entire folder
is set to `ignore`, or when a particular thread is snoozed. In every
case we would want the UI to update.
If setting a wide char to a Cell, mark the next one as empty in order to
skip printing it.
This prevents the following misalignment:
| subject
|📎 Fwd: RE:
| second subject