There's no need to clone MailViews when opening them in new tabs,
just initialize new ones with the same metadata. That saves us the
trouble of implementing Clone for all related types.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
There was no way to provide context to the user why their
command failed to be parsed. This commit paves the way of returning for
invalid domain values, invalid types, etc.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
So that if you select a mail/thread entry that is currently under the
cursor (making it `highlighted`) you can also see its `selected` status.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Well this was more complex that it should have been. And not very
optimized because we're not using pipelining in the submit() path:
1. first upload email bytes as a Blob object. This requires a standalone
API post call at a specific url so it cannot be changed with followup
calls to reference the blob's id.
2. Create an EmailObject in the drafts folder.
3. Create an EmailSubmission object referencing the email id of prevous
call. Unfortunately I cannot get the Result Reference to work in
stalwart jmap, so for now this is too a separate transaction.
Caveat emptor: Errors might not be returned to the user.
Closes#277.
https://git.meli.delivery/meli/meli/issues/277https://git.meli.delivery/meli/meli/pulls/279
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We will need this in the future when we're going to support extra
extensions like Blob and also now to support server submission.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
When pressing PageUp, PageDown, Home, End shortcuts in ThreadView
entries, the event is bubbled up to the mailbox listing because
ThreadView::process_event() didn't return `true`. This commit fixes
this bug.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
- Use HeaderName in parsers instead of raw byte strings.
- Use byte literal constants where appropriate instead of repeating
&b"___"[..]
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
When adding contacts from an envelope view, its hash/id/key was a random
Uuidv4, so it was always possible to add a contact again and again with
no limits. Now, the id is calculated from the hash of the email address
and display name, preventing duplicate additions.
Note that the hash algorithm is not supposed to be stable across
versions, meaning that in the future the same contact might have a
different hash. This means a more sophisticated method for
detecting/disallowing dupes must eventually be introduced.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Shortcut sections are shown in order, sorted by focus--as if widgets are
stacked vertically by the order you've opened them. In some widgets that
order was wrong.
Also, when a parent widget retrieved its child shortcuts, sometimes it
overwrote children sections if they both have them. This commit adds a
sealed trait ExtendShortcutsMaps that instead of overriding them, it
merges them with the child map having the priority.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
Sort with `sort <index> [asc/desc]` command or by pressing `1..5` keys.
Press them again to toggle between asc and desc.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
change_color() predated addition of Cell Attributes (Bold, Underline,
etc) so it didn't accept an attribute argument.
This commit adds a change_theme() function that does the same thing as
change_color() but also sets the cell attributes. It also takes a
ThemeAttribute as an argument instead of {fg, bg, attrs} individually.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We want to use SortOrder enum for non-thread purposes in the next
commit, so move it out of the thread module.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
We inspect errors in the frontend to check for network errors. If the
network error comes from std::io, this would get converted to an Error
with description "timed out", kind OSError, and source the actual
networking error.
This commit converts network std::io::ErrorKinds into appropriate
native ErrorKinds.
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>