Commit graph

3236 commits

Author SHA1 Message Date
Michael James Gratton
6182f466f5 Delay checking network connectivity if already connected. Bug 776042.
* 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.
2017-11-17 13:18:32 +11:00
Michael James Gratton
1d746e43c7 Fix sketchy line breaking in quoted plain text.
* src/engine/util/util-html.vala (smart_escape): Use "white-space:
  pre-wrap" for preserving whitespace to get decent work breaks.
2017-11-16 18:04:18 +11:00
Michael James Gratton
c2afe8fe48 Fix lost line breaks when selective quoting plain text. Bug 781178.
* 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.
2017-11-16 18:01:43 +11:00
Michael James Gratton
261e8a4ba3 Prevent composer body/sig/quote parts from losing focus. Bug 779369.
* ui/composer-web-view.js: Add a click handler for the document that
  prevents clicks outside the body parts from being processed.
2017-11-16 15:49:51 +11:00
Michael James Gratton
343bb640e9 Fix composer body text caret not being visible on reply. Bug 788797.
* src/client/composer/composer-widget.vala (ComposerWidget::set_focus):
  Ensure we grab the web view's focus only after its content has finished
  loading.
2017-11-16 12:49:49 +11:00
Michael James Gratton
f1e92feae2 Allow determining when JS has finished loading in ClientWebView.
* 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.
2017-11-16 12:44:57 +11:00
Michael James Gratton
7ad97fb5d9 Handle font-family strings containing both single and double quotes.
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.
2017-11-16 10:48:42 +11:00
Michael James Gratton
ccabe6ed6c Update testcase to fix failure introduced by commit da15ebe. 2017-11-16 10:37:29 +11:00
Michael James Gratton
81869a535d Don't use overwrite_confirmation with FileChooserNative, it's not supported. 2017-11-16 10:18:02 +11:00
Michael James Gratton
46d8462aaf Fix mistaken commit in flatpak-builder manifest from commit da15ebe. 2017-11-14 14:54:54 +11:00
Michael James Gratton
da15ebe3c0 Fix gnome-shell notifications missing an icon under flatpak. Bug 790103.
* icons: Rename application icons to match fully-qualified app name. Update
  references to the olde name with the fully-qualified app name.
2017-11-14 14:38:57 +11:00
Gautier Pelloux-Prayer
9727d41bfc Show notification when receiving new fails in INBOX subfolders as well. Bug 713227 2017-11-14 11:30:49 +11:00
Michael James Gratton
fddf609a97 Merge branch 'wip/789924-network-transition'. Fixes Bug 789924. 2017-11-12 22:16:45 +11:00
Michael James Gratton
304fa9dcc2 Add a IMAP pool stop timeout as well as a start to help prevent flapping.
* 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.
2017-11-12 22:10:11 +11:00
Michael James Gratton
f273058c2a Rely on the ready signal to re-open folder IMAP connections, not a timer.
* 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.
2017-11-12 22:08:09 +11:00
Michael James Gratton
ef258064ac Trigger account synchronizer when account becomes ready.
* 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.
2017-11-12 21:34:27 +11:00
Ask Hjorth Larsen
5b815f70d5 Updated Danish translation 2017-11-11 18:44:51 +01:00
Dušan Kazik
499b92e863 Update Slovak translation 2017-11-11 09:19:42 +00:00
Michael James Gratton
2a0cfc31a7 Don't delay opening remote folder when it is being waited on.
* 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.
2017-11-11 15:33:54 +11:00
Michael James Gratton
4218dbb715 Fix race between account becoming ready and MinimalFolder opening.
* 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.
2017-11-11 15:33:54 +11:00
Michael James Gratton
acb339f2ab Misc ClientSessionManager fixes. 2017-11-11 15:33:54 +11:00
Michael James Gratton
f64a2035c4 Minor SmtpOutboxFolder cleanup. 2017-11-11 15:33:54 +11:00
Michael James Gratton
2af9412740 Merge branch 'wip/768422-namespace-support'. Fixes Bug 768422 and Bug 726866. 2017-11-10 00:29:51 +11:00
Michael James Gratton
575d3f1d99 Only attempt to obtain an ImapClientSession when some are available.
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.
2017-11-09 17:13:00 +11:00
Michael James Gratton
ba5ae1f458 Ensure IMAP client sessions are closed when going offline.
* 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.
2017-11-07 14:04:56 +11:00
Michael James Gratton
b5b0ad9746 Minor deserialiser debug logging tidy up. 2017-11-07 14:04:56 +11:00
Michael James Gratton
3fb723731e Make SmtpOutboxFolder postman more robust.
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.
2017-11-07 14:04:56 +11:00
Michael James Gratton
ef8b3cf0f1 Reorganise and clean up SmtpOutboxFolder code. 2017-11-06 20:28:15 +11:00
Michael James Gratton
be8d8befec Start/stop outbox as the SMTP host becomes reachable/unreachable.
* 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.
2017-11-06 20:28:15 +11:00
Michael James Gratton
54194add44 Ensure only one ConnectivityManager instance is used per endpoint.
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.
2017-11-06 20:28:15 +11:00
Michael James Gratton
abcc2969ec Remove tabs from source code. 2017-11-06 20:28:15 +11:00
Michael James Gratton
b7ffd8242f Fix MainWindow not appearing when no passwords stored in keyring.
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.
2017-11-06 19:21:54 +11:00
Piotr Drąg
b68f2c6afc Update Polish translation 2017-11-05 16:06:12 +01:00
Matej Urbančič
0d14189ec7 Updated Slovenian translation 2017-11-04 13:02:07 +01:00
Marek Cernocky
ec469e40ed Updated Czech translation 2017-11-03 11:26:12 +01:00
Michael James Gratton
21421f8d48 Add unit tests for NAMESPACE parsing, CREATE serialisation, fix an error. 2017-11-03 16:52:21 +11:00
Michael James Gratton
13f8aa88ca Minor code cleanup. 2017-11-03 13:56:31 +11:00
Michael James Gratton
24bed9074f Minor special use handling clean up.
* 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.
2017-11-03 13:56:07 +11:00
Michael James Gratton
2015a72802 Add support for creating special use mailboxes.
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.
2017-11-03 13:53:14 +11:00
Michael James Gratton
bcca3f0332 Use default personal namespace when creating special folders. Bug 726866.
* 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.
2017-11-03 13:49:04 +11:00
Michael James Gratton
e361dc649a Further Imap.Account API tweaks.
* 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.
2017-11-03 13:41:36 +11:00
Michael James Gratton
3443b7f7dd Slighly improve sorting of po/POTFILES.in 2017-11-03 13:05:47 +11:00
Piotr Drąg
c6481c6f6d Translate GSchema
https://bugzilla.gnome.org/show_bug.cgi?id=771643
2017-11-03 13:05:47 +11:00
Piotr Drąg
42294ba38b Add XML declaration to the GSchema file 2017-11-02 18:57:21 +01:00
Piotr Drąg
9c1078ad16 Remove intltool markers from <caption> tags in AppData 2017-11-02 17:36:24 +01:00
Piotr Drąg
bfef27ed88 Add translator comments to .desktop files 2017-11-02 17:20:01 +01:00
Alan Mortensen
3e2389311c Updated Danish translation 2017-11-02 13:00:58 +01:00
Michael James Gratton
2a0fa4c746 Merge branch 'wip/771643-replace-intltool'. Fixes Bug 771643. 2017-11-02 19:15:08 +11:00
Michael James Gratton
e9bf7da63a Merge branch 'wip/784300-unlock-keyring'. Fixes Bug 784300. 2017-11-02 19:12:41 +11:00
Michael James Gratton
5dc8ace41c Merge branch 'wip/781488-aliyun-greeting-error'. Fixes Bug 781488. 2017-11-02 19:12:14 +11:00