* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer): Log periodic aspects of the account synchroniser
as PERIODIC.
* src/engine/imap-engine/imap-engine-minimal-folder.vala
(MinimalFolder::find_earliest_email_async): Remove two debug calls that
were getting triggered for every sync pass. These should be in the
synchroniser instead.
* src/engine/imap-engine/imap-engine-generic-account.vala
(GenericAccount): When closing, wait for each folder to close before
shutting down the local and remote connections.
* src/client/application/geary-controller.vala
(GearyController::close_async): Close both inboxes and accounts in
parallel. Don't wait for conversation monitor or inboxes to close
before closing the account now that the accound does so. The account
needs to start closing so that the background synchroniser stops, and
that needs to stop before any open folder will close. Otherwise if the
background synchroniser is currently synchronising an inbox or any open
folder, then the account will not close until the synchroniser
finishes, which could block for a long time.
* src/engine/api/geary-abstract-local-folder.vala (Folder),
src/engine/imap-engine/imap-engine-minimal-folder.vala (MinimalFolder):
Notify the close semaphore in the classes' ctors so that if they are
never opened, calling wait_for_close_async() does not block.
* src/engine/imap-engine/imap-engine-account-synchronizer.vala
(AccountSynchronizer): Don't try to disconnect from account signals in
dtor, the instance may already be gone.
* src/engine/imap/api/imap-account.vala (Account): Replace camel case
methods names with underscores per style guide, fix sense of
is_no_select test in fetch_folder_cached_async() to account for the
double nagative, and clean up the resulting if/else clause a bit.
Thanks to Torben for bug report and inital patch.
* src/engine/imap/transport/imap-client-session.vala
(ImapClientSession::get_delimiter_for_path): If the folder root does
not exist as a namespace, look for an empty namespace, then default to
the personal namespace.
This adds a dependcy on libunwind for generating the back trace.
* src/CMakeLists.txt: Require libunwind-generic package and libunwind
VAPI. Update docs and debian/control with new dependencies.
* src/engine/api/geary-problem-report.vala (ProblemReport): Generate a
stack trace in the default constructor if an error is specified.
* src/client/components/main-window-info-bar.vala
(MainWindowInfoBar::format_details): Include stack trafe from problem
report in output if present.
* ui/main-window-info-bar.ui: Add a ScrolledWindow around the TextView
since the details could now be quite large.
* bindings/vapi/libunwind.vapi: Add bindings for libunwind courtesy
Guillaume Poirier-Morency, add Error enum.
* 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/util/util-connectivity-manager.vala (ConnectivityManager):
Work with a NetworkAddress rather than an Endpoint to simplify a
bit. Use trillian for is-reachable property, since that's more
realistic Add new is-valid property and address_error_reported signal,
update and fire these when the reachability check reports an error
rather than just not reachable. Don't treat transient DNS errors as an
error, however. Update call sites.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala (SmtpOutboxFolder),
src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Look up to new address_error_reported signal
and clean up then report the problem when it is fired.
* src/engine/api/geary-problem-report.vala: New problem enum,
ProblemReport class and AccountProblemReport and ServiceProblemReport
subclasses that encapsulate error, account and service information when
reporting problems.
* src/engine/api/geary-account.vala (Account): Remove old Problem enum,
make report_problem signal and related notify methods accept a
ProblemReport instance instead. Reorganise protected methods a bit and
update subclasses and signal handlers.
* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
Substantially rework to handle ProblemReport instances via
for_problem() constructor.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala (SmtpOutboxFolder):
Substantially rework error handling yet again to get some better
ProblemReport instances being generated.
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Add new connection_failed signal, remove the
retry timer and simply report a connection error via the new signal.
* src/engine/imap/api/imap-account.vala (Account): Listen to new signal,
send a problem report through when a connection error occurs.
* src/client/application/geary-controller.vala (GearyController): Make
on_report_problem a proper method so it can be called internally, add a
trivial handler shim for compat.
(GearyController::on_retry_problem): Restart SMTP and IMAP clients when
requested.
* src/engine/api/geary-account.vala (Account): Add
start_incoming_client() and start_outgoing_client() methods to allow
clients to be restarted. Implement in subclasses.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala
(SmtpOutboxFolder::start_postman_async): Make public so it can be
called from GenericAccount.
* src/engine/api/geary-account.vala (Account.Problem): Remove
SEND_EMAIL_DELIVERY_FAILURE, we can't really and don't want to
distinguish between and general sending failures. Remove uses.
* src/engine/imap-db/outbox/smtp-outbox-folder.vala (SmtpOutboxFolder):
Use new global auth retry constant.
(SmtpOutboxFolder::postman_send): Always throw auth error when we hit
max attempts, always throw non-TLS errors so we don't keep on blindly
retrying.
* src/client/application/geary-controller.vala
(GearyController::report_problem): Replace connection failure dialog
with use of an info bar.
* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
Add new infobar type for incoming mail errors.
* src/engine/api/geary-account.vala (Account.Problem): Rename
CONNECTION_FAILURE to RECV_EMAIL_ERROR to be consistent with
SEND_EMAIL_ERROR, update uses.
* src/engine/api/geary-account.vala (Account): Add internal constant for
maximum number of authentication attempts.
* src/engine/imap-engine/imap-engine-generic-account.vala (Account):
Move auth-related code to Imap.Account.
* src/engine/imap/api/imap-account.vala (Account): Keep track of the
number of auth failures and bail out when the max has been
reached. Manually notify the ClientSessionManager when the user has
updated their creds so it only restarts as a response to user input.
* src/engine/imap/transport/imap-client-session-manager.vala
(ClientSessionManager): Don't keep track of imap credentials changing,
add new credentials_updated() method to allow Imap.Account
notify when they have changed instead.
* src/client/components/main-window-info-bar.vala (MainWindowInfoBar):
New class and UI file for displaying an info bar in the main window, as
well as providing a way to show technical informartion if needed.
* src/client/components/main-window.vala (MainWindow): Add a Gtk.Frame
and container to hold inforbar instances. Show it when showing an
infobar, and hide it when there are none. Add show_infobar() method to
provide a cromulent way of adding info bars.
* src/client/application/geary-controller.vala (BaseObject): Rather than
bailing out on an account when an error occurs, display an info bar
instead.
* ui/geary.css: Style the info bar frame to only show a border between
main content and the info bars.
* 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.