Update to be compatible with Application.Controller composer lifecycle
changes, add matching signals so plugins can decorate composers as
they are created.
Keep track of Plugin.Composer implementation instances so that the same
object can always be returned for the same Composer.Widget instance.
Update plugin call sites.
Since plugins especially require the ability to customise a composer
ideally before presenting it, split up composer construction into two
phases: `compose_blah` methods that find a matching composer or
constructa new one, then `present_composer` to present it.
Add `composer_registered` and `composer_deregistered` signals, fired
as appropriate so other code paths (again, plugins in particular) can
hook into composer lifecycles.
Update call sites for new API and to explicitly present new composers.
Introduce new PluginGlobals and PluginContext to encapsulate global and
per-context state, respectively. Pass these objects to various plugin
interface implementations instead of doling it out piecemeal.
Now that InfoBarStack supports a priority queue, use that for folder
and email stacks, and set the required priority property when
constructing info bars for plugins, so that the highest priority
info bar is always shown.
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.