Allow specifying the connect greeting timeout length, ensure that
any connect errors are in place before releasing the connect waiter,
add unit test to ensure it works properly.
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.
Move args from open_async to ctor and use these to determine and store
DB file and attachment paths as properties. This allows constructing
the DB instance up front and markig it as non-nullable, simplifies
calling patterns and hence allows removing one use of the deprecated
Engine singleton, and by moving in the local data deletion
implementation from ImapEngine.GenericAccount, also allows removing a
static helper method.
find . -name '*.vala' -type f -exec sed -i 's/ *$//g' {} +
The following files was ignored:
test/client/composer/composer-web-view-test.vala
test/engine/util-html-test.vala
Fix#271
Remove it from Geary.Engine, since it just adds complexity without
making API client use any easier. Replace the TLS negotiate method on
the remaining versions of the signal with the Endpoint, since it's handy
to have and the negotiation method can be obtained from that if needed.
Rather than using cascading signals to indicate an auth error, have
ImapClientSession throw an appropriate exception, and catch that as
needed in ImapClientService and the Engine's validation code.
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.
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.
We can't rely on getting the IMAP creds from the account, since we may
be validating updated services and the IMAP creds may be different then
those on the account.
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.
Use the new TlsNegotiationMethod enum rather than Endpoint's flags
and simply require StartTLS negotiation if requested. Move the
endpoint cache into the Engine, since that actually uses it and is
looking for something to do these days. Have service-specific
providers setup a ServiceInformation instead of endpoints, so their
service info shows up in the accounts editor.
Update call sites etc.
Split up account validation up into IMAP and SMTP validation so clients
can manually manage it. Don't bother trying to validate email address and
nick names, that can and should be done by clients.
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.
* src/client/accounts/account-manager.vala (AccountManager): Keep track
of disabled and unavailable accounts as well as enabled accounts. If an
known GOA account cannot be properly loaded, keep it around as a
disabled account. When GOA accounts are removed, just disable them
instead.
Since one of the main uses of Geary.Service to get endpoints, also
replace use of Service with ServiceInformation.
* src/engine/api/geary-service-information.vala (ServiceInformation): Add
an endpoint property, allowing instances to be passed around whenever
an endpoint is needed, rather than needing to switch on service type in
AccountInformation.
* src/engine/api/geary-account-information.vala (AccountInformation):
Remove endpoint properties and accessors. Provide an explicit means to
hook up to endpoints on the IMAP and SMTP ServiceInformation to get
notifications of untrusted hosts. Update call sites.
* src/engine/api/geary-engine.vala (Engine): Since we now explicitly hook
up untrusted hosts signals on AccountInformation, don't let the same
account be added twice.
* src/engine/api/geary-engine.vala (Engine): Move account_added and
account_removed signals to AccountRemoved since the engine isn't
tracking this any more. Remove bool param from add_account for the same
reason and update call sites.
* src/engine/api/geary-engine.vala (Engine): Require a ServiceInformation
object for IMAP and SMTP when creating orphan info objects. Update call
sites.
* src/client/accounts/account-manager.vala (AccountManager): provide
factory methods for constructing local service info objects. Use these
when re-constituting accounts. Use a singleton SecretMediator object
instance as a bonus.
* src/client/accounts/add-edit-page.vala (AddEditPage): Get
ServiceInformation objects from the account manager, pass an instance
of GearyApplication through so it has access to the manager. Update
call chains back to GearyController to pass the app instance through.
Instead of passing in user config and data base dirs to the Engine from
the app, then pulling them out from the engine again from the app, just
store them in AccountManager, since that's where they are needed.
* src/client/accounts/account-manager.vala (AccountManager): Store user
config and data base dirs directly rather than getting them from the
engine. Split account directory creation out into a separate method so
they aren't re-made every time the config is saved.
* src/engine/api/geary-engine.vala (Engine): Remove user config and data
dir properties and open_async args. Update call sites and unit tests.
* src/client/application/geary-controller.vala (GearyController): Chase
AccountManager and Engine API changes. Ensure account dirs are created
when an new account is added.
* src/engine/api/geary-account-information.vala (AccountInformation):
Explicitly track copies rather relying on account dirs being
null. Don't require dirs be set in the default ctor, since they won't
be known, provide a method for updating them later on instead.
This commit makes the Imap.Account and Imap.Folder classes work somewhat
more like Imap.ClientSession, in that they have become higher-level
wrappers around ClientSession which come and go as the client session
does (i.e. as the connection to the IMAP server comes and goes). Further,
partly decouple account session lifecycle in ImapEngine.GenericAccount
and the folder session in ImapEngine.MinimalFolder from those objects
being opened/closed, so that sessions are created only when open /and/
the IMAP server is available, and disconnected on close /or/ when the
underlying connection goes away.
As a result, GenericAccount and MinimalFolder no longer claims a client
session on open and try to keep it forever. Instead if needed, they wait
for the server to become contactable.
This makes Geary much more robust in the face of changing network
connections - when working offline, resuming after sleep, and so on.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer): Trigger synchronizer when the account becomes
ready, not when it opens. Ensure when synchronizer halts when a remote
error is encountered, so when going off-line it doesn't attempt to
continue.
* src/engine/imap-engine/imap-engine-generic-account.vala
(GenericAccount): Make Tie AccountSynchronizer a property to tie its
lifecycle that of its account. Stop the synchronizer when the account
is stopped.
* src/engine/imap-engine/imap-engine.vala (ImapEngine): Remove
now-redundant AccountSynchronizer lifecycle code, update call sites.
This adds two ServiceInformation properties for IMAP and SMTP,
and removes all separate properties in AccountInformation which
are now redundant. No functional changes for now.
* src/engine/api/geary-engine.vala (Engine::create_orphan_account): Fix
sense of test when determining the next account id to use. Add unit
tests.
(Engine::add_account): Made public so it can be used in public test.
* src/engine/api/geary-account-information.vala (AccountInformation):
Make main constrcutor public, pass in the id rather than divining it
from the config dir's name for both ctors. Update call sites.
* src/engine/api/geary-engine.vala (Engine): Also make the ctor public.
* configure: Allow specifying a custom valadoc executable.
* src/CMakeLists.txt: Tidy up valadoc command, include dependencies when
in generated HTML output, enable warnings.
* src/engine/api/geary.vala: Provide boilerplate doc comment for the
Geary namespace.
* src/engine/api/geary-email.vala, src/engine/rfc822/rfc822.vala: Don't
use single-line doc comments, valadoc doesn't support them (see Bug
736483).
* src/engine/api/geary-folder-path.vala: Fix errors reported by valadoc.