* src/engine/util/util-connectivity-manager.vala: Add both a next-check
time and a delayed check timer so that if we are already connected and
a check ran recently, re can avoid running one again for a little while.
* src/engine/rfc822/rfc822-utils.vala (quote_body): Smart escape quoted
part, preserving whitespace if source message is plain text. Throw
exceptions rather that catching them to clean the code paths up a
bit. Update call sites.
* src/client/composer/composer-widget.vala (ComposerWidget::set_focus):
Ensure we grab the web view's focus only after its content has finished
loading.
* src/client/components/client-web-view.vala (ClientWebView): Add
is_content_loaded property and content_loaded signal, update and fire
when getting a contentLoaded message from the WebProcess.
* ui/client-web-view.js: Fire the contentLoaded message when loading is
complete. Add ClientPageStateTest test case to ensure it is working
fine.
* test/client/components/client-web-view-test-case.vala
(ClientWebViewTestCase::load_body_fixture): Use is_content_loaded
rather than is_loading as the test for loading having finished, since
we're actually interested in when the JS has finished loaded, not the
resources.
Fixes a failing unit test with WebKitGTK 2.18.
* ui/composer-web-view.js (EditContext::init): Check for and strip both "
and ' from start and end of font-family string.
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Increase the start timeout and add a stop
timeout to suppress connection flapping when e.g. the system is
connecting to a network.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
Remove the reestablishment timer and code to automatically reestablish
the remote connection when it is closed. Add a class doc comment.
* 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.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
(MinimalFolder.wait_for_open_async): Cancel the timer if remote hasn't
already opened, so it opens immediately.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
remove remote_ready attr, just use the property on Imap.Account. This
ensures that if the account is already ready, the folder opens right
away.
This commit really does two things:
1. Ensures that users of ImapClientSession don't attempt to get one
when they shouldn't.
2. Ensures that users of ImapClientSession are notified when one is
available.
This doesn't update the background synchronizer however, that will happen
next.
* src/engine/imap/transport/imap-client-session-manager.vala
(ImapClientSessionManager): add is_ready property and ready
signal. Keep these up to date as auth and connectivity changes.
* src/engine/imap/api/imap-account.vala (Account): Also add is_ready
property and ready signal, proxy these through from the client session
manager so we don't need to expose that implementation detail to uses
of the class.
* src/engine/imap-engine/imap-engine-generic-account.vala
(GenericAccount): Simply the process for calling the folder enumeration
process, and make sure it gets cancelled if running and the account is
closed. Ensure that it doesn't attempt anything remote if the remote
account is not ready. When the remote account becomes ready, launch an
enumeration right away.
* src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
Simply the process for opening the rempte folder. Ensure that it isn't
attemptted before the remote account is ready. Do open the remote
folder when the account becomes ready.
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Start checking for connectvity updatess when
the manager is opened and stop chekcing when closed. Remove
is_endpoint_reachable property since it's now available from the
endpoint's connection manager. Use a TimeoutManager for handling auth
error retrys. Add a force_disconnect_all() method to handle closing all
outstanding client connections.
(ClientSessionManager::on_connectivity_change): When the host becomes
reachable, start adjusting the session pool but only after a short
delay to prevent connection bouncing on quick changes. When becomoming
unreachable, force client sessions closed so that any being used are
dropped immediately rather than after the sessions eventually time out.
Currently there are a bunch of weird edge cases when things go wrong
sending mail. This commit cleans up the class futher to make sure no
dataloss occurs.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala
(SmtpOutboxFolder::start_postman_async): Move all code related to
sending and saving mail out to a seperate postman_send() method. Ensure
that if any hard or soft error occurs, the row is always enqueued and a
nap is always had.
(SmtpOutboxFolder::postman_send): Rework how SMTP auth failures are
handled so we don't need to work around the napping code. Don't catch
hard errors, let them go through to the caller.
* src/engine/api/geary-account.vala (Account.Problem): Make send error
names consistent. Update uses.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala
(SmtpOutboxFolder::SmtpOutboxFolder): Add a listener to the SMTP
endpoint's connection monitor when its account opens that manages
whether the postman should be running or not, and disconnect this
listener when the account closes.
(SmtpOutboxFolder::start_postman_async): Add a cancellable to control
when the loop it should exit, ensure that gets used when sending,
saving, etc.
(SmtpOutboxFolder::stop_postman): New method to manage the posbox
cancellable.
Reduce the number of
Add a ConnectivityManager to each endpoint
* src/engine/api/geary-endpoint.vala (Endpoint): Add an endpoint manager
property, initialise it with the endpoint.
* src/engine/util/util-connectivity-manager.vala (ConnectivityManager):
Make the Endpoint property a weak ref to avoid a circular dep.
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Use the endpoint's connectivity manager rather
than our own.
Fixes problem introduced by commit 157a109e.
* src/client/application/secret-mediator.vala (SecretMediator): Recreate
SCHEMA_COMPAT_NETWORK schema object locally since using a CCcodr attr
doesn't seem to work.
* src/engine/imap-engine/imap-engine-generic-account.vala
(Account::update_folders_async): Don't fall over creating special use
folders if only one fails.
* src/engine/imap/response/imap-mailbox-attributes.vala
(MailboxAttributes::get_special_folder_type): Remove duplicate clause.
The IMAP CREATE-SPECIAL-USE extension allows specifying the use of a
mailbox being created. We should use it if present.
* src/engine/imap/api/imap-account.vala (Account::create_folder_async):
Add optional SpecialFolderType param, if present use command variant
that accepts it.
* src/engine/imap/command/imap-create-command.vala (Command): Add
additional ctor that accepts a SpecialFolderType param. If present,
add a USE list to the command sent.
* src/engine/imap/response/imap-capabilities.vala (Capabilities): Add
CREATE-SPECIAL-USE to the list of known capabilities, sort the list.
* src/engine/imap/api/imap-account.vala (Account): Add
get_default_personal_namespace() method to return a folder at the root
of the default personal namespace.
* src/engine/imap/transport/imap-client-session.vala (ClientSession):
Make inbox and namespace attrs into RO internal properties so Account
can access them.
* src/engine/imap-engine/imap-engine-generic-account.vala
(Account::ensure_special_folder_async): Get the default namespace
folder and use that when checking for matching folders, rather than
trying to guess just at the root then INBOX. If not found, assume the
folder should be a child of the root.
* src/engine/imap/api/imap-account.vala
(Account:list_child_folders_async): Renamed to
fetch_child_folders_async to match other remote-y methods, make returb
value non-null since nulls suck. Fix call site.