Commit graph

460 commits

Author SHA1 Message Date
Rico Tzschichholz
e09475e81d Constructors of abstract classes should not be public 2019-03-15 09:49:05 +11:00
Michael Gratton
12c6bbca56 Fix signature not being updated when composer first opened without one
The ComposerPageState JS object assumed that if no signature was present
when first loaded, that none ever would be. This broke changing the
signature when the composer was opened for an account without one, and
the from account was changed to an account with a sig.

Instead of including the signature as part of the loaded body, always
include just a skeleton signature DIV and ensure the signature is loaded
dynamically after the body has been loaded. Update code and tests to
match this assumption, and add a unit test for updating the sig.

Fixes #309
2019-03-11 12:19:57 +11:00
Michael Gratton
6c8f192148 Attempt to de-mangle From names from Mailman, GitLab, etc
Some software like the above will mangle From mailbox names by appending
"via Some Service" to the From mailbox name. This messes up generating
default avatars for the actual people sending these messages, so
attempt to de-mangle the names.

This involves moving primary originator determination from the engine
to the client, since it's now a policy thing. Add unit tests.
2019-03-09 20:17:01 +11:00
Michael Gratton
76ee07595d Make avatar code a bit more robust in the face of bad input
Don't try to dray null initials, actually return null per API contract
when no initials can be found, don't include non-alphanumerics in the
initials. Add test case.
2019-03-09 20:17:01 +11:00
Michael Gratton
4e484e237d Make TestCase.assert_string robust in the face of null actuals 2019-03-09 20:17:01 +11:00
Michael Gratton
9ed81ed759 Remove default instance of ClientWebView's PageState JS object
This default instance was causing double the number of preferred height
events, which was likely creating a race for ConversationWebView. This
might (should?) fix plain text email with quotes sometimes showing up
with a vastly incorrect height.

To ensure that a PageState is constructed properly, make ClientWebView
abstract and use replace the one direct use of the class in the accounts
editor for the signature with a new subclass.

See #283
2019-03-06 20:11:33 +11:00
Michael Gratton
a5beccc64e Fix RFC822 mailbox names with commas breaking composer address entry
When pasting an email address copied from Geary, replying to a message
or entering an address via autocmoplete in the composer, and the
recipient's mailbox name contains a comma, it needs to be quoted so
that it is not parsed by the entry as two seperate addresses.

Fixes #282
2019-03-02 15:11:13 +11:00
Michael Gratton
9ba7c75cd4 Add some tests for decoding/encoding quoted names in RFC822 mailboxes 2019-03-02 14:25:21 +11:00
Kristian Klausen
48c93655cf Remove trailing whitespace
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
2019-02-28 23:05:31 +01:00
Michael Gratton
a6c1962e47 Apply custom user CSS to composer web view as well as to conversations
This allows people with dark themes to apply style to the cmoposer's
body editor as well as to conversation bodies. Note that this CSS does
not get sent, so WYSIWYG will break if people choose to do this.

Also renames the user CSS file from user-message.css to user-style.css,
but still looks for the old name for now.

Fixes https://bugzilla.gnome.org/show_bug.cgi?id=714129
2019-02-28 18:34:28 +11:00
Kristian Klausen
9ef6d7ccec Replace all tab indentation with 4 spaces
find . -name '*.vala' -type f -exec sed -i.orig 's/\t/    /g' {} +
and a few manual adjustment.

Fix #271
2019-02-27 19:19:58 +01:00
Michael Gratton
2ad91f5f4d Fix failing test after icon change 2019-02-24 21:50:27 +11:00
Michael Gratton
b41ef0a5b7 Merge branch 'wip/259-arm64-test-failure' into 'master'
Assert FolderPath comparisons properly in unit tests

Closes #259

See merge request GNOME/geary!136
2019-02-24 04:46:54 +00:00
Michael Gratton
ca846edf59 Improve AccountInformation.service_label generation
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
2019-02-22 16:56:32 +11:00
Michael Gratton
9c3fdbfb5c Assert FolderPath comparisons properly in unit tests
Fixes #259, Debian FTB failure on arm64.
2019-02-22 15:46:14 +11:00
Michael Gratton
4d57ab9b62 Default Outlook accounts to not save sent mail
See #65
2019-02-20 14:06:02 +11:00
Michael Gratton
5475290272 Allow both accounts and services to have provider-specific defaults
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.
2019-02-20 13:55:17 +11:00
Michael Gratton
af676e0572 Fix FolderPath mis-sorting doubly-disjoint paths
E.g. a>d should be less than b>c, not the other way around.

Fixes #224
2019-02-19 17:31:11 +11:00
Michael Gratton
b3b44ccd42 Work around DB tests always failing on gcc150.osuosl.org CI runner
See Infrastructure/Infrastructure#97
2019-02-19 17:12:26 +11:00
Michael Gratton
2c4fe9b77f Merge branch 'wip/weak-refs-for-callback-managers' into 'master'
Prevent circular refs using idle and timeout manager when running

See merge request GNOME/geary!110
2019-02-18 00:39:32 +00:00
Michael Gratton
9619d18eda Ensure conversations that have no email in the base folder are dropped
If a least one email in a conversation that is in the base folder but
also in another is removed from the base folder, the conversation may
not be removed from the monitor despite possibly not having any email
in the base folder, since the email may not have been completely removed
from the conversation.

This was particulary being seen with GMail accounts where even single
message conversations were not disappering when trashed because the
converation's email was still in All Mail.

This fix does a few things: Avoids hitting the database when checking
a conversation still has email in the base folder, when it does check
only ensures that email are in the base folder, not *any* folder, and
updates ConversationSet::remove_all_emails_by_identifier to do this
check iternally, clean up its API and implementation and avoids having
to use out args calling it.
2019-02-16 16:26:10 +11:00
Michael Gratton
67bf1183e6 Add base_folder property back to ConversationSet
Athough it was removed a while back, add it back since it is not only
needed when adding conversations, but also when removing email from
conversations to be able to detect when a conversation should be
dropped.
2019-02-16 16:10:47 +11:00
Michael Gratton
3cda1b5c6b Prevent circular refs using idle and timeout manager when running
If an IdleManager or TimeoutManager had been scheduled, it would not get
destroyed until it was executed by the main loop, causing criticals
if the objects enclosed by its callback had been destroyed.

This adds a weak reference to the manager object itself when scheduling
on the main loop, so it can get safely dropped.
2019-02-16 15:58:08 +11:00
Michael Gratton
744cde0c2f Don't update a folder's unread email count during normalisation
Updating the unread count after opening a folder and finding email that
has an unexpected unread status messes up the count obtained from the
server, which has already taken these messages into account.

Here, both the main normalisation process and the email flag updater are
prevented from adjusting the unread count for a folder when they
encounter email that are new and unread, or have an unread status
different from what was last seen by the engine.

See #213
2019-02-15 13:40:04 +11:00
Michael Gratton
539893fb72 Add some unit tests for setting email flags 2019-02-13 18:41:49 +11:00
Michael Gratton
00d381d6a9 Trivial test case cleanup 2019-02-08 11:26:39 +11:00
Michael Gratton
0f554d2371 Fix select-quoting not preserving newlines in some cases
If the common ancestor of the quoted text is the plain-text-message DIV
itself, the isDescendant test fails and the style to preserve new lines
is not maintained. This adds a non-strict check to isDescendant and
enables that when checking the common ancestor node and a test case for
it.
2019-02-02 15:07:41 +11:00
Michael Gratton
c83f07a9f1 Minor tweaks for ConversationPageState.isDescendantOf
Use uppercase since that is what the DOM for HTML defaults to, use
nodeName rather than tagName for cases when there the check is false and
ancestor is the document element, add unit tests.
2019-02-02 15:07:41 +11:00
Michael Gratton
35150701e3 Merge branch 'buzzert/deleted_flags' into 'master'
Fixes bug where messages marked for deletion still appear in message list

See merge request GNOME/geary!54
2019-02-02 02:47:46 +00:00
Michael Gratton
719bbca901 Ensure ImapDB.DatabaseTest and AccountTest dispose of their db instances
Make sure the database these instances are/have are destroyed before
deleting the database file, so it is definitely not being kept open.
2019-01-22 01:49:36 +11:00
Michael Gratton
8a057a2086 Fix name of temp dir used in ImapDB.AccountTest 2019-01-22 00:57:26 +11:00
Michael Gratton
5f73eb94b2 Use standard recursive delete in ImapDB.DatabaseTest 2019-01-22 00:57:26 +11:00
James Magahern
30e9e8950b Merge branch 'master' into buzzert/deleted_flags
* master: (212 commits)
  Import standard GNOME Flatpak CI config rather than copy/pasting it
  Update Gitlab CI Flatpak build with standard template
  Fix build with new FolderPath API
  Only collapse runs of space, tab, carriage return, and newline
  Do not add non openable folders entry in sidemenu. Bug 712902
  Reducing padding in conversation viewer list
  Fix build warnings
  Fix possible critical when removing an account is removed
  Fix local accounts for special-case providers not configured correctly
  Rework GenericAccount::ensure_special_folder_asyc yet again
  Add some useful debugging to GenericAcount
  Fix ambiguous test in AccountInformation.set_special_folder
  Fix pathological FolderPath.is_equal() case, add unit test
  Revamp Geary.FolderPath implementation
  Add additional FolderPath unit tests
  Convert Geary.FolderRoot to be an actual root, not just a top-level
  Stop duplicate inboxes being created, not being listed
  Ensure MinimalFolder remote open forces closed on hard errors
  Ensure accounts don't accidentially create multiple inbox-type folders
  Remove unwanted debuging cruft
  ...
2019-01-20 12:59:06 -08:00
Alex Henrie
82cd2d92e1 Only collapse runs of space, tab, carriage return, and newline
Closes #184
2019-01-14 19:54:14 -07:00
Michael Gratton
e1fd9daa83 Fix pathological FolderPath.is_equal() case, add unit test 2019-01-15 00:20:37 +11:00
Michael Gratton
ddbe6e0b09 Revamp Geary.FolderPath implementation
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.
2019-01-15 00:20:37 +11:00
Michael Gratton
423a1dcbf0 Add additional FolderPath unit tests 2019-01-15 00:19:46 +11:00
Michael Gratton
5a22e8e4a2 Convert Geary.FolderRoot to be an actual root, not just a top-level
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.
2019-01-15 00:18:45 +11:00
Michael Gratton
faf7a2bdfd Add some unit tests for Geary.ImapDb.Account folder management 2019-01-14 11:01:03 +11:00
Michael Gratton
19d2fdfcbc Update Geary.Endpoint API and source
Use a generic GSocketConnectable to specify the remote endpoint,
simplify TLS cert management callbacks.
2019-01-09 15:22:19 +11:00
Michael Gratton
18d847826a Merge branch 'improve-plaintext-conversion' into 'master'
Add plaintext quote marker to blockquote lines in one pass

See merge request GNOME/geary!73
2019-01-09 00:50:01 +00:00
Michael Gratton
fcc658af97 Merge branch 'wip/17-noisy-problem-reports' into 'master'
Problem reports are too noisy

Closes #17

See merge request GNOME/geary!74
2019-01-07 23:25:47 +00:00
Alex Henrie
a9efe8fd3a Add plaintext quote marker to blockquote lines in one pass 2019-01-01 17:55:28 -07:00
Michael Gratton
20447c814f Provide common account and service status tracking via Account
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.
2019-01-01 22:29:07 +11:00
Michael Gratton
827db39fe2 Provide common service status tracking via ClientService
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.
2019-01-01 22:29:07 +11:00
Alex Henrie
00da60debe Delineate tags a, b, i, and u in plaintext conversion 2018-12-31 11:36:41 -07:00
Michael Gratton
ebe4e190ac Fix credentials not being updated in the engine when changed in editor
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.
2018-12-27 10:34:43 +10:30
Michael Gratton
95ebdd65d2 Tidy up ClientService API a bit
Require endpoint to always be present so it is never null, and hence
passed in through account creation. Rename props to be a bit more
descriptive.
2018-12-27 10:20:58 +10:30
Michael Gratton
3049837973 Check for conflicting config and data dirs when generating an account id 2018-12-26 15:42:40 +10:30
Michael Gratton
56906e1f35 Fix failing account manager tests
This makes Accounts.Manager more easily unit testable by supplying a
credentials mediator for libsecret, rather than constructing one
internally.
2018-12-26 15:27:47 +10:30