Commit 37d904b5 added a partial change to how drafts are saved and
loaded - saving plain text only when not in rich text mode and
loading HTML-based drafts that don't seem to have originated from Geary
and plain-text-only drafts as the body so that Geary's composer-internal
HTML markup is still present.
However this introduced a double signature when loading plain text
drafts back since Geary would assume the body (including sig) is the
message body and appending a new sig to that.
This addresses the issue above by always saving drafts with HTML parts
even when in plain text only mode.
Ensure composer state is restored when loading draft replies and that
`referred_ids` is updated top include the messages the draft refers to.
Make the process for loading different context types more obvious by
doing the work in-place, especially for replies, and avoiding multiple
utility methods that also branch based on type.
Use standard RFC822 classes for managing In-Reply-To and References, and
merge id lists rather than simply concatenating them. Ensure both are
updated when adding additional replies to the email, and they are always
set on any composed email constructed.
Add unit tests for all of the above.
Defining an interface for the composer to access application objects
and services decouples it from Application.Controller, allowing it to be more
easily unit tested.
Replace use of Application.Client and Application.Controller in the
composer and add some basic unit tests.
Although when processing mailbox addresses lists are effectively sets,
the ordering can be important for people. As such, make `equal_to`
comparisons require identical ordering, and add new `contains_all` for
order-independent comparisons.
By defining an interface for account object access, classes that use it
are decoupled from Application.Controller, allowing them to be more
easily unit tested.
Engine mocks don't need to be in the `Geary` namespace, and including
them there makes it difficult to use them in client tests, so put them
all in their own name-space and corresponding directory.
Ensure that when setting values from server responses on a Geary.Email
that the flags are still updated even when values are null (e.g. set
Email.Field.DATE even if no Date header was present) so that clients
can tell that the value is in fact null and that email field prereq
checks aren't accidentally triggered.
Even if the a message has an invalid message id or message id list
header value, we need to keep parsing the message to ensure we can
do *something* useful with it.
Even if the a message has an invalid message id or message id list
header value, we need to keep parsing the message to ensure we can
do *something* useful with it.
Using the high-level representation avoids having to re-parse and
re-format the list.
Update the util method Geary.RFC822.Utils.reply_references to support
this.