Also handle continuation of cleanup after old messages have been
detached. Flagged vacuuming is performed even when the cleanup
interval hasn't been reached. The tracking of last background
cleanup time in Account.Information is possibly temporary and isn't
yet persisted.
Make subclasses implement these themselves and remove the unique string
property, to be (hopefully) more efficient and easier for subclasses
to specialise.
Clean up search API so that query string parsing and error handling can
be pushed out to the client.
Rename Geary.Account::open_search factory method to ::new_search_query
to better reflect what it actually does.
Update Geary.SearchFolder::search to be async so it can throw errors and
the caller can catch them, require SearchQuery objects instead of plain
text query strings.
Add Geary.SearchQuery::owner property so that the query's account can be
sanity checked.
Update API documentation to reflect this.
Now that its singleton is gone, and since it's ::open_asyc and
::close_async methods don't do anything async, just merge the former
with the class's ctor and make the latter non-async.
Explicitly construct an instance in Application.Client and ensure it
is closed there as well instead of in the controller, for consistency.
Keep a single ordered list of accounts around, construct accounts
when their config is first added, and prefer accessing accounts by
config rather than id.
Remove Geary.Account::send_email and the sending progress monitor in
favour of exposing Geary.Smtp.ClientService as a public class and so
allowing clients to acccess those symbols from Geary.Account::outgoing.
Also make ::send_email a convenience class for doing a save/queue and
expose those operations, so clients can managage the two seperately if
desired (e.g. for undoing sending).
Finally, make Outbox.Folder public since it's exposed by the SMTP
service and maybe clients want to do something more detailed with it
anyway?
Add Geary.Folder::synchronise_remote method to allow clients to
explicitly check for new mail in a folder. Move code from
ImapEngine.AccountSynchronizer as the basic implementation, but also
ensure pending replay queue notifications are processed before the
process is complete.
Replaces harvesting code in ImapDB code so as to be stand-alone and
reusable. Implement harvesting policy to only harvest from a set of
whitelisted special folder types (so junk and trash is not harvested)
and only harvest valid, non-spoofed, addresses.
Prepare for doing composer autocomplete via queries by not loading all
contacts at startup in the engine. Update Geary.ContactStore API to that
end, and convert Geary.Account.get_contact_store accessor method to a
property.
If a FillWindowOperation didn't load a full amount of messages, it just
assumed that there were no more to load. This is not true however when
loading locally, the folder's vector isn't fully expanded, and it gets
to the end of the vector.
This patch fixes the operation to also queue another fill if the
monitor's folder message window is smaller than the folder's total
message count.
Fixes#289
If the primary email address matches the incoming host name, use that.
Else use a prefix of the hostname but only if it is more that two domain
parts long. E.g. don't shorten "other.com" to "com".
Fixes#261
This updates both AccountInformation and ServiceInformation to
implicitly apply provide-specific defaults, allowing the same
mechanism to provide defaults for accounts, and meaning that API
clients do not need to do this themselves any more. Add unit tests.
Convert getters that look like properties into actual properties,
remove unused and redundant public and internal API, convert
implementation to use a tree that aucyally maintains references between
steps, rather than each creating a new list of path steps and
manipulating that.
Instead of each top-level IMAP folder being a FolderRoot object, then
children of that being FolderPath objects, this makes FolderRoot an
"empty" FolderPath, so that both top-level and descendant folders are
plain FolderPath objects. Aside from being more technically correct,
this means that empty namespace roots can now be used interchangably
with non-empty namespace roots (addressing issue #181), and custom
folder implementations no longer need to provide their own trivial,
custom FolderRoot.
To support this, a notion of an IMAP root and a local root have been
added from which all remote and local folder paths are now derived,
existing places that assume top-level == root have been fixed, and
unit tests have been added.
Similarly to ClientService, add a `current_status` property that denotes
the account's operational state, so that clients can just set a notify
on that to be informed of all account status changes. Keep the property
updated by watching for changes to the client service's status property.
This adds a `current_status` property to ClientService to track the
service's operational state, wich can be monitored by both the engine
and clients for changes. Hook up subclasses to keep that update, and
move connectivity management in to ClientService to provide a common
implementation.
Add a method to Accounts.Manager to update credentials for local
accounts. Update Geary.ClientService to enable both an endpoint and
service config to be updated when changed, and simplify how that gets
done. Update Accounts.EditorServerPane to ensure these get called.
Remove remaining crufty properties left over from pulling accounts out
of the engine, rename imap/smtp to incoming/outgoing since maybe one
day other protocols or implementations will be supported. Remove the
old pairs of properties for TLS and SMTP auth, replace the
SmtpCredentials enum with something that is also independent of
protocol.
In practice, the same mediator is always being used for both services,
and by removing it from ServiceInformation we can provide default
instances for both IMAP and SMTP, meaning we can load account config
before service config, making handling loading for both much tidier.
This (way too large patch) enables versioning in config files, and
provides a mechanism by which to load older versions from a newer
version of Geary. It also properly introduces a new v1 config format
that adds several groups to geary.ini to make it easier to read and to
distinguish between incoming/outgoig services rather than IMAP/SMTP.
To do this, a few things that should have happened in seperate patches
were also done:
* Make AccountInformation's imap and smtp properties mutable (they
aren't stateful any more anyway), make ServiceInformation non-abstract
again and remove the subclasses (to get config versioning happening
without an explosion of a classes, it all has to be handled from the
AccountManager anyway), and some other misc things.
This finishes conversion from the old approach (primary+aliase list) to
the new (a single ordered list). API is simplified a bit, and some
convenience properties are added.
Get the account's id (renamed fron "name") from the account's config and
construct the id internally. Construct the ImapDB.Account instance
internally as well since it doesn't require any input from the engine.
This removes Endpoint from ServiceInformation and moves it to a new
ClientService class, since ServiceInformation is for apps to provide
configuration, and Endpoints are effectively implementation detail. The
new ClientService class is in effect an analoge to ServiceInformation
in the same way as Account is to AccountInformation, and so this is a
better place to store an account's endpoints. Two instances have been
added to Account as `incoming` and `outgoing` properties instead of imap
and SMTP to be a bit more generic and with an eye to supporting other
protocols in the future.
This is possble to implement now non-generic providers are populating
ServiceInformation classes rather than Endpoints directly, and reduces
the complexity of the code needed to manage endpoints since all of the
untrusted_host callback complexity in AccountInformation and the Engine
can be removed, and will also allow simplifing credentials and SMTP
codepaths somewhat.
This work has been broken up in to thee parts to make the changes
clearer.
Pass service provider to ctor so we can make the service provider
property immutable. Fill in service label in ctor so it's always set to
something useful. Move creating orphans from Engine to AccountManager
since it exists only to assign an internal id for new accounts, so it
should handled by the account manager anyway.
This doesn't make any sense for local-only folders, and only gets used
for internal implementation details for IMAP folders, so remove the
public API and replace its use internally.