Commit graph

460 commits

Author SHA1 Message Date
Michael Gratton
48ed8d9fe3 Geary.Account: Support creating folders in the personal name space
Add `create_personal_folder` method, implement it in
ImapEngine.GenericAccount. Use this when creating required special
folders to reduce code duplication.
2020-04-23 09:35:19 +10:00
Michael Gratton
400850cc44 Geary.AccountInformation: Rework how special use folder paths are stored
Use a simple list of strings to store path steps, since we don't know
what the root will be in advance, and this leads to errors if callers
try to compare the info's paths to (say) an actual IMAP path.

Store path steps in a SpecialUse to path step map property, rather than
as individual properties for each special use, to reduce repetition.
2020-04-23 09:35:19 +10:00
Michael Gratton
e22d74db4b Geary.Folder: Add SpecialUse.CUSTOM and set_used_as_custom method
Support applications setting custom special uses for folders.
2020-04-18 18:37:35 +10:00
Michael Gratton
3b0815a1dc Geary.Logging: Remove Flag enum
Now that we have classes logging on sub-domains, and the ability to
suppress specific domains, remove flags and switch over to doing
domain suppression for manipulating debug settings in the client.
2020-04-15 17:05:09 +10:00
Michael Gratton
d84899e064 test: Enable engine logging if test harness verbose flag is set 2020-04-10 14:31:41 +10:00
Michael Gratton
c98efafb28 Fix failing test after test case async changes 2020-04-10 14:29:20 +10:00
Michael Gratton
196f05e595 test/test-case.vala: Rename TestCase async calls to match AsyncCallWaiter's 2020-04-10 12:58:09 +10:00
Michael Gratton
768f6afc78 test/test-case.vala: Add AsyncResultWaiter class
Add new class to allow testing interleaving of multiple async calls.
Re-implement TestCase's support for this using an internal instance
of the new class.
2020-04-10 12:39:56 +10:00
Michael Gratton
749096cd38 test/mock-object.vala: Add explicit support for mocking async calls
Provide async equivalents of the `blah_call` methods, implement the
given async behaviour of expected async calls.
2020-04-10 12:39:56 +10:00
Michael Gratton
02adcfa8aa test/mock-object.vala: Allow ExpectedCall to specify async behaviour
Add new AsyncCallOptions enum and property to allow specifying if async
calls should continue immediately, continute when idle, or pause until
manually released.

Add properties and method to allow check for and resuming a paused
async method.
2020-04-10 12:39:56 +10:00
Michael Gratton
8dcab7f306 Geary.SpecialFolderType: Rename class and related properties, signals
The `SpecialFolderType` was somewhat mis-named, since the special use
does not (in most cases) confer any special type, rather it's simply
defines what a particular folder is used /for/.

As such, rename the enum to to `Geary.Folder.SpecialUse`, moving it in
to the `Folder` class, since it relates specifically to folders, also
rename `Folder::special_folder_type` and
`Folder::special_folder_type_changed` reflect the above and not
duplicate the type name, and similarly rename
`Account::folders_special_type`.

Update the many call sites.
2020-03-31 16:15:57 +11:00
Michael Gratton
32acff51b8 Geary.SpecialFolderType: Rename SPAM to JUNK
The latter is more general as it can also be used for malware, etc,
and less evocative of processed pig products.
2020-03-31 15:37:38 +11:00
Michael Gratton
297a59ca80 Merge branch 'mjog/imap-connection-fixes' into 'mainline'
IMAP connection fixes

See merge request GNOME/geary!479
2020-03-30 11:35:18 +00:00
Michael Gratton
2eb597fec1 Geary.RFC822.Message: Always re-determine the encoding for body parts
When attaching body parts to a message from a composed email, don't
re-use the transfer encoding used from the plain part for the HTML part,
since the latter may be different if e.g. the HTML contains no line
breaks and hence is a single long line.

See #771
2020-03-29 16:29:30 +11:00
Michael Gratton
f3c02c7800 Geary.RFC822.Utils: Ensure best encoding/charset not missing data
By not closing/flushing the buffer, ::get_best_charset and
::get_best_encoding were not including the last line of the buffer, and
missing single very long lines when guessing the encoding.

Fixes #771
2020-03-29 16:24:58 +11:00
Michael Gratton
42152d00ba Geary.RFC822.Message: Work around long HTML lines exceeding SMTP max len 2020-03-29 09:51:17 +11:00
Michael Gratton
b53d5b2470 Simply Geary.Imap.ClientService selected mailbox handling
Convert mailbox and mailbox RW/RO state accessors to properties and
rename to be more explicit about what they mean. Remove mailbox arg
from ::getProtocolState() since it's unused.
2020-03-27 08:29:14 +11:00
Michael Gratton
9e01d8dca0 Remove Geary.Imap.ClientSession::server-data-received signal
This was only being used internally, and it leaks low level details out
of the mid-level abstraction.
2020-03-27 08:29:14 +11:00
Michael Gratton
7ac72379bb Update Geary.Imap.ClientSession namespace handling
Add namespace accessors, handle updating namespaces when processing
the received data, not when executing the command so that unsolicited
namespaces are still recognised. Clear namespaces when new data is
receieved and when not in selected and auth states. Add unit tests.
2020-03-27 08:29:14 +11:00
Michael Gratton
b46838f100 Update Geary.Imap.Capabilities handling
Move Capabilities to the api directory and make immutable.

Don't pass around out params to simply increment the revision and use a
field in ClientSession, just use the last capability instance. Ensure
after starting a TLS session capabilities are cleared. Add unit tests
for getting both implicit and explicity capaibilities when initiating
a client session.
2020-03-27 08:29:14 +11:00
Michael Gratton
13d43d41b2 Update Geary.Imap.ClientSession connect timeout handling
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.
2020-03-27 08:29:14 +11:00
Michael Gratton
54156003b4 Add TestCase.assert_double 2020-03-27 08:29:14 +11:00
Michael Gratton
62f1df12cb Rework Geary.Imap.ClientConnection signal and error handling
Remove connect, disconnect and close_error signals, since they are
implied by their respective methods completing and/or throwing an
error. Remove Deserializer pass-through signals, treat all three kinds
as generic receive errors instead.

Make Deserializer emit end-of-stream signal only on EOS, not on EOS and
on receive error, so it only signals an error condition once.
2020-03-27 08:29:14 +11:00
Michael Gratton
7e77133bda Update Geary.Imap.Command API
Make the class abstract, since it only gets used by subclases. Allow
a null cancellable when waiting for the command to complete.
2020-03-27 08:29:14 +11:00
Michael Gratton
339d8ae26e Add unit test for Geary.Imap.ClientSession 2020-03-27 08:29:14 +11:00
Michael Gratton
95c1916abf Add unit test for Geary.Imap.ClientConnection 2020-03-27 08:29:14 +11:00
Michael Gratton
6d22950129 Add a simple mock server for testing network code 2020-03-27 08:29:14 +11:00
Michael Gratton
fe760ff40a Geary.RFC822.Message: Fix Message-Id header not being set
The port to GMime 3 missed setting the Message-Id header on the
underlying GMime Message object when constructing a message, from a
ComposedEmail, so this was not getting set on outoging email.

Fixes #758
2020-03-25 14:05:23 +11:00
Michael Gratton
cfa414f08c Util.Avatar::extract_initials_from_name: Don't strip diacritics
Normalise to composed forms rather than decomposed forms, which would
replace diacritics on characters with combining chars, making them
disappear from the generated initials.

Fixes #735
2020-03-17 22:43:50 +11:00
Michael James Gratton
cbe6e0ba9b Revert "Merge branch 'mjog/558-webkit-shared-process' into 'mainline'"
Revert merge request GNOME/geary!374 for now since the shared process
model breaks old-style WebProcess message handler IPC.

This can be un-reverted when out JS is ported to the new Messages API
that is landing in WebKitGTK 2.28.

This reverts commit e4a5b85698, reversing
changes made to 66f6525480.
2020-02-13 12:56:52 +11:00
Chris Heywood
01e114f09a Fix detach_emails_before_timestamp test case
That's ImapDB.Folder::detach_emails_before_timestamp, fixed
and enabled.
2020-02-10 16:04:13 +01:00
Chris Heywood
a6595ebc2f Merge branch 'mainline' into remove-old-msgs-beyond-storage-pref 2020-01-24 10:32:19 +01:00
Chris Heywood
e7d3b46b37 Temporarily disable test 2020-01-22 12:19:16 +01:00
Chris Heywood
150417727e Test case for detach_emails_before_timestamp
ie. ImapDB.Folder::detach_emails_before_timestamp.
2020-01-22 10:23:13 +01:00
James Westman
0eed1bb21a composer: Add font buttons to toolbar
This replaces the menu options in the overflow menu with nicer looking, more
discoverable toolbar buttons. They work much the same way as before.
2020-01-21 19:43:37 -06:00
Chris Heywood
4875b66485 Bump schema version in database test case 2020-01-21 18:22:11 +01:00
Chris Heywood
f60c42a36b More explicit class identification 2020-01-09 14:08:46 +01:00
Chris Heywood
7dfe2971c6 Rename and improve doc. on method 2020-01-09 13:07:17 +01:00
Chris Heywood
5d53bbec26 Merge branch 'mainline' into remove-old-msgs-beyond-storage-pref 2020-01-08 14:43:52 +01:00
Chris Heywood
609ee01e3e Trigger idle cleanup per account when backgrounded
Also handle continuation of cleanup after old messages have been
detached. Flagged vacuuming is performed even when the cleanup
interval hasn't been reached. The tracking of last background
cleanup time in Account.Information is possibly temporary and isn't
yet persisted.
2020-01-08 14:08:52 +01:00
Michael Gratton
b08cee7883 Fix build warning. 2019-12-21 18:31:03 +11:00
Torben
77d44d41a3 Merge branch 'mainline' into letorbi/gmime-3 2019-12-18 11:38:02 +01:00
Michael Gratton
cc0fb9eef2 Remove unused Geary.Folder::list_local_email_fields_async method 2019-12-18 09:25:07 +11:00
Michael Gratton
dda8d9baf1 Remove distinct search folder email identifiers
The only reason SearchFolder.EmailIdentifier exists was to store the
date for ordering the folder, but that can be done with any old class,
meaning we can simply pass though existing ImapDb ids to clients, fixing
a lot of bugs and corner cases along the way.
2019-12-18 09:25:07 +11:00
Torben
7da9ee1252 Fix undefined variable error 2019-12-17 13:41:35 +01:00
Torben
ca2bab0338 Re-activate and improve prepare_header_text_part() test 2019-12-17 13:23:28 +01:00
Torben
c0e8f717e8 Allow addresses without domains (fixes disabled mailbox-addresses-test) 2019-12-16 00:34:30 +01:00
Torben
82c2b36c6e Make mailbox-address tests pass 2019-12-14 00:04:03 +01:00
Michael Gratton
924104c282 Clean up search folder implementation
Move SearchFolder and search EmailIdentifier implementation out of
ImapDb and into its own package. Decouple both from ImapDB, and improve
the implementation, fixing a few inefficiencies. Merge search
FolderProperties into the SearchFoldern implementation as an inner
class.

Merge SearchTerm into ImapDB.SearchQuery as an inner class and move the
outer class's source down a level, since it was the only file left in
the imap-db/search dir.
2019-12-12 10:47:52 +11:00
Michael Gratton
b3488f6cf9 Add Geary.Account::list_local_email_async
Add new method and implementation to support breaking search folder
impl out of the ImapDb package.
2019-12-12 10:47:52 +11:00