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".
std::convert::From<&std::string::String> for String was introduced in
1.36.0 and version below that version fail. Use `to_string()` instead to
make it build again.
Adds support for contacts (Cards) marked as `external_resource` which
prevents modifications from happening. No way to import external
contacts is added yet.
CardId is the "Primary Key" of the contact type, Card. Meli-created
contacts had UUIDs for their CardId. In order to import external
contacts and ensure their primary key is the same each time, CardId is
made into an enum to add hashing as a choice.
- move set_seen to Listing component (instead of having it in Listing's
child Component)
- add default values to shortcut definition macro `shortcut_key_values`
- do not redefine default values in each `shortcuts` method after
getting all valid shortcuts from `context.settings.shortcuts.*.key_values()`
Page movements is an enum that describes the movements of the keyboard
keys "Home, End, PageUp, PageDown". Some mail listing Components
interpret these keys as changes to their cursors.
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.
If a listing lists search results, ie when "filtering" with a filter
term, it sets up its state in filtered_selection, filtered_order etc.
set_coordinates() should reset that state.
Attachment needs to know the range of bytes where the body part of the
attachment is located. The Attachment.raw field contains the entire
attachment, headers and body. The new Attachment.body fields contains a
`StrBuilder` which contains the offset and length of the body part inside
`raw`.
If Sent folder wasn't correctly configured, the sent message would be
lost. With this change it tries these folders in this order:
1. Sent
2. Inbox
3. Any other normal folder
The check is done by looking at the special usage metadata on each
folder. If everything fails, the message is saved in a file in the
tmpfs.
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.
By convention the valid values at any time of a cursor_pos in mail
listings is in self.new_cursor_pos, which the listing compares with
self.cursor_pos to detect position changes. Returning
self.cursor_pos values with coordinates() is invalid.
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.
This mail list view shows one entry per thread just like CompactListing,
but the entry is slightly bigger just like in some GUIs, and when the
thread is opened the view becomes 3 columned:
+--+-------+----+
|~~|-------|~~~ |
|~~|-------|~~ |
| |-------| |
| |-------|~~~ |
+--+-------+----+
This is meant to be used with bigger terminal sizes