Flag and tag modifications are now somewhat typed better, and the
frontend applies them on its own on success. This means that if you set
an unseen mail as seen but it was already seen in the backend, you will
see the change locally. Previously it would remain unseen.
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>
- 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>
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>