Commit graph

460 commits

Author SHA1 Message Date
Michael Gratton
cb16bdc59d Remove default Geary.EmailIdentifier::hash and ::equal_to impls
Make subclasses implement these themselves and remove the unique string
property, to be (hopefully) more efficient and easier for subclasses
to specialise.
2019-12-12 10:47:52 +11:00
Michael Gratton
981ea845f4 Make Geary.EmailIdentifier serialisation a bit less ad-hoc
Require EmailIdentifier implementations to use an outer GVariant of the
form `(yr)` (that is, a byte and an arbitrary length tuple), so that
inner representations are independent of the outer format.
2019-12-12 10:47:52 +11:00
Michael Gratton
c93cfc38b1 Clean up Engine search API
Clean up search API so that query string parsing and error handling can
be pushed out to the client.

Rename Geary.Account::open_search factory method to ::new_search_query
to better reflect what it actually does.

Update Geary.SearchFolder::search to be async so it can throw errors and
the caller can catch them, require SearchQuery objects instead of plain
text query strings.

Add Geary.SearchQuery::owner property so that the query's account can be
sanity checked.

Update API documentation to reflect this.
2019-12-12 10:47:52 +11:00
Torben
d98755d04f Create new GMime.Part instances with an explicit MIME-type 2019-12-11 23:25:59 +01:00
Torben
ea646d7083 Merge branch 'mainline' into letorbi/gmime-3 2019-12-03 09:28:22 +01:00
Michael Gratton
dc665d20dd Update Geary.ImapEngine classes to implement Geary.Logging.Source 2019-12-02 16:31:42 +11:00
Michael Gratton
56601cfb5c Ensure AccountProcessorTest stops its test article
Add ::tear_down, stop the test article from running, so it doesn't
keep executing after tests have run.
2019-12-02 10:40:31 +11:00
Torben
1aac6f2284 Change GMime dependency from 2.6.17 to 3.2.4
This commit squashes several non-compiling commits:

66dd6500 Change required GMime version to 3.2.4 or higher
4b9c8a38 Fix some compilations errors in test code
98aa5a2e Fix some (hopefully) last compilation errors
558360c6 Fix parser format when getting message headers
cc248ffc Fix name of stream-buffer mode
b293c66b Fix another iteration over a header-list
52fa183f Fix parsing of Gmime parameters
e078ee62 Use Unix2Dos-, Dos2Unix- and/or SmtpData-filters instead of 'FilterCRLF'
ff31b8e5 Fix setting of email headers
eb676482 Fix compilation errros due to string-uint8-char conversion problems
8558769f Fix datetime conversion
d44a28cd Remove some obsolete arguments
1ce81662 Pass charset where it's required
6013806f Pass GMime.ParserOptions to header-decode methods
986d05a0 Pass GMime.FormatOptions where it's required
e9b93187 Pass GMime.ParserOptions where it's required
640ce667 Fix compilation errors in GMime initialization
312f80bf Remove use of GMime.HeaderIter
acc73d14 Change GMime dependency from 2.6 to 3.0
54fc250a Adapt names to 'offical' gmime-2.6 bindings

The commits are part of the branch 'letorbi/gmime-3-spread', which can be
found at: https://gitlab.gnome.org/letorbi/geary/tree/letorbi/gmime-3-spread
2019-12-01 12:37:39 +01:00
Michael Gratton
8140135d7b Fix Components.WebViewTestCase fixture setup and tear down
Move config and web view creation into ::set_up, set them to null in
::tear_down.
2019-11-26 14:26:03 +11:00
Michael Gratton
ceb9c9764a Rename ClientWebView to Components.WebView per code style 2019-11-26 14:26:03 +11:00
Michael Gratton
ca6cbecb83 Add manual Components.Validator::validator method
Support manual validation where needed, add unit tests.

This also slightly changes the behaviour of non-required field, since
an empty non-required field should be valid.
2019-11-20 17:11:14 +11:00
Michael Gratton
89642c5283 Replace uses of Gee.TreeSet where used for sorting
Add new Geary.Iterable::to_sorted_list method that should be more
performant than adding elements to a sorted set and sorting one-by-one,
use that instead of a TreeSet.
2019-11-20 12:46:36 +11:00
Michael Gratton
e4cbff8bfa De-cruftify Geary.Collection utility functions
Remove functions that have as-convenient methods in up-tp-date Gee,
rename ::get_first to ::first so it reads better and add API docs,
replace ::to_array_list with ::copy, since that's what's actually
needed.
2019-11-19 19:22:38 +11:00
Michael Gratton
dccb81fcb1 Rework Geary.Engine lifecycle managment
Now that its singleton is gone, and since it's ::open_asyc and
::close_async methods don't do anything async, just merge the former
with the class's ctor and make the latter non-async.

Explicitly construct an instance in Application.Client and ensure it
is closed there as well instead of in the controller, for consistency.
2019-11-19 09:41:09 +11:00
Michael Gratton
ecfd772c07 Clean up Geary.Engine account API and implementation
Keep a single ordered list of accounts around, construct accounts
when their config is first added, and prefer accessing accounts by
config rather than id.
2019-11-19 09:41:04 +11:00
Michael Gratton
56876365ba Rename GearyApplication class and source to match code style
Rename `GearyApplication` => `Application.Client` and
`geary-application.vala to `application-client.vala`. Update call sites
and test cases.
2019-11-17 21:38:29 +11:00
Michael Gratton
29042bb2d8 Move composer classes into their own namespace
Rename all composer classes prefixed with "Composer" so that the prefix
is a namespace instead. This increases the compartmentalisation of the
classes, making `internal` a useful member modifier and makes them
consistent with the code style guide.
2019-11-17 20:00:02 +11:00
Michael Gratton
1447d1acbc Minimise DOM changes made by ComposerPageState::cleanContent JS
By overriding ComposerPageState::getHtml to accept a parameter that
supports getting HTML with empty composer parts removed, cleanContent
can simply be made to linkify the page, thus allowing a ComposerWidget
to be re-used multiple times when sending an email.
2019-11-17 20:00:01 +11:00
Michael Gratton
43803239a4 Replace Geary.Account::send_email w/ Smtp.ClientService methods
Remove Geary.Account::send_email and the sending progress monitor in
favour of exposing Geary.Smtp.ClientService as a public class and so
allowing clients to acccess those symbols from Geary.Account::outgoing.

Also make ::send_email a convenience class for doing a save/queue and
expose those operations, so clients can managage the two seperately if
desired (e.g. for undoing sending).

Finally, make Outbox.Folder public since it's exposed by the SMTP
service and maybe clients want to do something more detailed with it
anyway?
2019-11-17 20:00:01 +11:00
Michael Gratton
cc4389f41d Make Geary.ComposedEmail implement Geary.EmailHeaderSet
This allows it to be used in exchange with the Geary.Email and
RFC822.Message classes in places.
2019-11-17 19:59:19 +11:00
Michael Gratton
e426517b30 Rename Config class and source file to match code style
Rename `Configuration` => `Application.Configuration` and
`geary-config.vala to `application-config.vala`. Update call sites and
test cases.
2019-11-17 16:53:42 +11:00
Chris Heywood
979e8b42ac Added a few tests for RFC822.Message
- Inline attachments in from_composed_email
- get_recipients
- get_searchable_body
- get_searchable_recipients
- get_network_buffer
2019-11-17 16:40:13 +11:00
Chris Heywood
eaa98883a7 Tests for ComposedEmail.contains_inline_img_src and replace_inline_img_src 2019-11-17 16:40:13 +11:00
Michael Gratton
c002285fef Geary.App.ConversationMonitor: Fix re-entrancy issues
Avoid some issues if a monitor is closed as it is still being opened,
clean up the API and implementation a bit.
2019-11-07 11:58:56 +11:00
Michael Gratton
09f6fc094a Improve Geary.Account API for listing folders
Make both Account.list_folders and Account.get_special_folder not throw
any errors - either the folders exist, or they don't. Update call sites.
2019-11-05 11:35:31 +11:00
Michael Gratton
94e0736cfd Update Geary.Outbox.EmailIdentifier variant type marker
Use 'o' instead of 's' to avoid confusion with search ids. Add test.
2019-10-30 14:17:44 +11:00
Michael Gratton
bf4f5c4780 Fix GenericAccount::to_email_identifier not actually working
The GVariant type "*" only matches a single data type, not many, and
the sense of the test to check serialised ids was wrong anyway. As a
reuslt, this method probably never worked. Add a unit test.
2019-10-30 14:12:52 +11:00
Michael Gratton
753a67f40a Merge branch 'links' into 'mainline'
Don't linkify text near a URL that looks like a URL with a bad protocol

See merge request GNOME/geary!339
2019-10-26 05:31:55 +00:00
Michael Gratton
737bdba158 Merge branch 'mjog/571-imap-fetch-space-workaround-redux' into 'mainline'
IMAP body part fetch space workaround redux

Closes #571

See merge request GNOME/geary!342
2019-10-26 05:24:03 +00:00
Michael Gratton
0cf5ab734b Merge contacts when harvesting them
Now that ContactStore no longer merges contacts, do so in the harvester.
2019-10-25 14:54:53 +11:00
Michael Gratton
0c563cf101 Fix ContactStoreImpl not saving flags removed from a contact
Don't try to merge contacts, just assume the updated contact passed in
is canonical.
2019-10-25 14:53:59 +11:00
Alex Henrie
feed89225f Don't linkify text near a URL that looks like a URL with a bad protocol 2019-10-22 18:53:18 -06:00
Michael Gratton
ab77067d8a Fix RFC822.Header.get_header_names returning null names
The custom GMime VAPI assumed the call to get_iter() actually returned a
new iter, but it doesn't. Fix that, update Header class style, and add
tests.
2019-10-22 17:20:52 +11:00
Michael Gratton
f6e270f83d Merge branch 'mjog/ci-updates' into 'mainline'
CI updates

See merge request GNOME/geary!331
2019-10-16 03:01:14 +00:00
Michael Gratton
8206cf434d Remove Flatpak test locale hack, just use en_US.UTF-8 for now
FDO 19.08 runtime now includes C.UTF-8 locale, but since Fedora
now ships one that collates high-bit chars, it differs compared
to Debian et al's and FDO.

As a result, just use en_US.UTF-8 for now, probably until glibc
actually ships it and so they all agree.
2019-10-16 13:36:29 +11:00
Michael Gratton
69e3cdf9b5 Fix ComposerPageState::containsAttachmentKeyword
Just use ComposerPageState::htmlToText to get the email's main content
without quotes, not some custom code.
2019-10-07 23:49:12 +11:00
Michael Gratton
a8ef91f3a8 ui/composer-web-view.js: Improve keyword detection
Update ComposerPageState.containsKeywords to split on any punctuation,
not just spaces, so that text like "see the attachment." will get
detected.
2019-10-07 23:48:38 +11:00
Michael Gratton
5732d23e98 ui/composer-web-view.js: Add element blacklist to htmlToText
Update ComposerPageState.htmlToText() to allow ignoring certain elements
if needed. Update tests to test the function directly rather than going
through ComposerPageState.toText().
2019-10-07 23:42:49 +11:00
Michael Gratton
af2915707d Consistently use '..._c_args' and '..._vala_args' for meson vars 2019-09-27 23:56:52 +10:00
Michael Gratton
b9cbe81e12 Merge branch 'wip/christopherdavis/dual-install' into 'mainline'
build: Set up dual install for flatpak

See merge request GNOME/geary!229
2019-08-28 09:10:14 +00:00
Michael Gratton
f6e97db5b5 Merge branch 'wip/imap-disconnects-ignored' into 'mainline'
IMAP disconnects ignored

See merge request GNOME/geary!292
2019-08-28 07:53:45 +00:00
Christopher Davis
bfcee9bff7 build: Set up dual install for flatpak
Part of https://gitlab.gnome.org/GNOME/Initiatives/issues/1;
Sets up dual installation for flatpaks, allowing us to
build and run geary without affecting our system install.
This will allow testing of nightlies and CI artifacts as well
via the flatpak, so we can iterate on designs and share
bundles to test with.
2019-08-26 09:38:31 -07:00
Michael Gratton
eb6afae358 Rename UNCONNECTED FSM and protocol state to NOT_CONNECTED
The former is ambiguous, the latter is not.
2019-08-26 13:55:43 +10:00
Michael Gratton
6871c1cd90 Make remote folder synchronisation a top-level API method
Add Geary.Folder::synchronise_remote method to allow clients to
explicitly check for new mail in a folder. Move code from
ImapEngine.AccountSynchronizer as the basic implementation, but also
ensure pending replay queue notifications are processed before the
process is complete.
2019-08-26 13:32:53 +10:00
Michael Gratton
983e8ce74e Mark Geary.Account.open_search as async and throwing an error
This lets us make the DB stemmer lookup async when constructing a
search query async and cancellable. Fix call sites.
2019-08-18 22:00:40 +10:00
Rico Tzschichholz
5c909334b7 Add missing generic arguments in engine tests to fix valac criticals
See https://gitlab.gnome.org/GNOME/vala/issues/835
2019-08-15 08:36:46 +02:00
Joe Barnett
15e0d18dd6 Fix 100% CPU usage on mismatch utf escapes in rfc822 string
Since we're adding 2 to the index_of return value, we can't
compare to -1.

See issue #504
2019-08-06 17:06:44 -07:00
Michael Gratton
329d0380e9 Add some minor unit tests 2019-08-06 21:37:39 +10:00
Michael Gratton
2a0de1ce41 Remove Util.Webkit namespace and functions
After the JSC migration they were all a bunch of simple inline
one-liners, so were just making the code more complex than it needed to
be.
2019-07-21 10:46:42 +10:00
Michael Gratton
df8a96c104 Clean up meson dependency lists 2019-07-21 10:05:24 +10:00