Commit graph

455 commits

Author SHA1 Message Date
Niels De Graef
8c31a8de21 tests: Fix ImapDB test after C.UTF-8 change
You can test that this should be the correct order by adding a line for
each on a file and then running

```
$ cat "$TEST_FILE" | LC_ALL=C sort -r
```

Fixes: 43c23270a6 ("migrate locale from en_US.UTF-8 to C.UTF-8")
2025-07-15 21:49:05 +02:00
Kamila Łopuszańska
43c23270a6 migrate locale from en_US.UTF-8 to C.UTF-8 2025-07-11 22:01:05 +00:00
Cédric Bellegarde
f25ced7223 test: Update composer Reply-To handler 2024-02-02 10:57:16 +00:00
Cédric Bellegarde
40a2c1aec4 client: Always load email once view is mapped
Remove CSS width workaround.

Fix #283 #1205
2023-08-20 21:41:24 +00:00
Cédric Bellegarde
98eb063398 treewide: Remove deprecated run_javascript()
#1497
2023-08-10 23:55:20 +00:00
Cédric Bellegarde
3daa44276a client: Unused since we moved to libfolks 2023-03-01 10:43:40 +00:00
Cédric Bellegarde
80aa742686 tests: Disable sandboxing for now
https://bugs.webkit.org/show_bug.cgi?id=213174
2023-02-23 15:28:27 +00:00
Cédric Bellegarde
1a7a3a987a engine: Cancel any remote folders update before marking a message
When marking a message, a race condition can happen:
- A remote folders update is already running
- We mark the message locally and replay it remotely
- The previous remote update result restores invalid values locally
2022-09-26 11:03:13 +02:00
Richard Adenling
efca9615a6 engine: Fix flag being mistaken for a response code
The parser would think the flag was a response code if the flag started
with a '[' character. Flags like these are sometimes returned by Gmail
which broke fetching emails from Gmail.

This commit checks if the parser is already parsing flags and if so
treats any starting '[' characters as part of the flag string.
2022-09-20 18:32:37 +02:00
Cédric Bellegarde
ddb8a273ce treewide: Removed unused Yahoo imap engine
This is not useful now we have autoconfig support
2022-09-07 12:10:06 +00:00
Richard Adenling
8fb10db1de Correct the conditional comments in the test data
This fixes the problem with libxml2 2.9.14 not considering <![ to be a
valid way to open a tag anymore.

Closes #1367
2022-05-10 21:18:01 +02:00
Guido Günther
fb3642149a tests: Split client and JS tests
This gives each suite a longer time and keeps things separate.

Suggested in https://gitlab.gnome.org/GNOME/geary/-/merge_requests/670
2021-07-05 11:50:12 +02:00
Guido Günther
fe30e49b74 tests/client: Make sure WebView tests load resources
Without that the client tests fail like

  ** (test-client:74671): CRITICAL **: 11:32:40.613: void webkit_user_content_manager_add_style_sheet(WebKitUserContentManager*, WebKitUserStyleSheet*): assertion 'styleSheet' failed

This was so far masked since the composer-page-state-test JS tests did
that but test suites should be independent.
2021-07-05 11:50:12 +02:00
Michael Gratton
454cc0bcfe build: Fix Flatpak CI test failures caused by meson 0.57
Add previously implicit build dependencies for tests.

See GNOME/gnome-build-meta#372,
https://discourse.gnome.org/t/meson-0-57-update-may-break-tests-ci/6220
2021-04-23 00:59:02 +10:00
Julian Sparber
6a052031df avatar: Use HdyAvatar for displaying avatars 2021-04-04 12:44:32 +10:00
Michael Gratton
3c4d5c5e9d Geary.RFC822.MailboxAddress: Handle long headers being folded
Remove "\n " sequences from RFC822 text before decoding so that any
long mailboxes/mailbox lists folded before the 80 char limit are
unfolded.

Fixes #1009
2021-01-20 19:24:17 +11:00
Michael Gratton
b51b933b6d Geary.RFC822.Subject: Handle long headers being folded
Remove "\n " sequences from RFC822 text before decoding so that any
long subject lines folded before the 80 char limit are unfolded.

Fixes #895
2021-01-20 19:20:30 +11:00
Michael Gratton
642bf00e88 Util.Email.SearchExpressionFactory: Use ICU for work breaking
Implement search query text word segmentaion using ICU, so that
languages that don't use spaces for word delimiters are correctly
tokenised.
2021-01-19 20:49:01 +11:00
Michael Gratton
f560707271 Geary.FtsSearchQuery: Fixes for email text disjunctions
Ensure OR is actually used to separate disjuncts, don't prefix match
non-stemmed terms when a stemmed version exists or when EXACT is
specified. Ensure column is correctly specified per disjunct.
2021-01-19 20:48:17 +11:00
Michael Gratton
9bd2359464 Geary.Account: Make new_search_query synchronous
Constructing a new query should be fast, and it no longer needs to be
done async, so remove async from the method and simplify callers.
2021-01-19 20:48:17 +11:00
Michael Gratton
20a4fd3ed2 Geary.ImapDb.SearchQuery: Rename to Geary.FtsSearchQuery
There's nothing IMAP-specific about the class, so move it to common
and rename to reflect what it is actually used for.
2021-01-19 20:48:17 +11:00
Michael Gratton
2ab7b2c39e Geary.ImapDb.SearchQuery: Handle queries with some/all negated terms
SQLite FTS5 doesn't allow all negated terms in matches, and since NOT
is a binary operator (rather than unary) negated terms should be listed
after any positive terms.
2021-01-19 20:48:17 +11:00
Michael Gratton
6ffbfcf5d4 Geary.ImapDb.SearchQuery: Handle folder and deleted message exclusions
Ensure designated excluded folders, folderless messages, and
marked-for-deletion messages are excluded from FTS search results.
2021-01-19 20:48:17 +11:00
Michael Gratton
6a614adf73 Geary.ImapDb.SearchQuery: Use expression to generate FTS5 queries
Move SQL generation for FTS search from ImapDb.Account to SearchQuery.
Convert to use Geary.SearchQuery.Term instances to generate SQL, rather
than parsing the expression. Simplify the generated SQL substantially
and generate MATCH values that work with SQLite FTS5.
2021-01-19 20:48:17 +11:00
Michael Gratton
0112c8192c Geary.SearchQuery: Allow client apps to build search queries
Adds classes that allow building arbitrary query expressions and require
an instance to be provided to Geary.SearchQuery, to be set as a
property.

This enables query expressions to be parsed by clients instead of the
engine, in which ever whay they choose.
2021-01-19 20:48:17 +11:00
Michael Gratton
4fe0d92147 engine: Convert from SQLite FTS3/4 to FTS5 for full-text-search
Add SQL migration that drops the old FTS4 MessageSearchTable table,
re-create as a FTS5 table, clean up the column names a bit, and adds a
flags column so unread/starred queries can be made fast.

Define a SQLite FTS5 extension function `geary_matches()` to replace
the FTS3 `offsets()` function which no longer exists in FTS5, based on
Tracker's implementation.

Update code to FTS5 conventions (docid -> rowid, etc), use new column
names, populate and update the flags column as the email's flags
change, and use new match function for getting matching tokens.

Advanced searches are probably currently broken, these will be fixed
by subsequent commits.
2021-01-19 20:48:17 +11:00
Michael Gratton
ec3057daf7 ConversationWebView: Fix plain text emails sometimes being too wide
Using `whitespace: pre-wrap` to format plain text email sometimes
causes additional width to be allocated by the plain text blocks that
then does not get used due to the constraints on the HTML element.
The allocated space remains however and hence an un-needed horizontal
scrollbar appears.

Using `break-spaces` instead seems to help since it allows breaks after
a space character, leading to the additional space not otherwise being
allocated.
2020-10-17 15:08:10 +11:00
Michael Gratton
4f9df7d74a engine: Remove in-tree unicodesn stemmer
Now that search is using libstemmer, the in-tree stemmer is no longer
needed and can be removed.
2020-10-14 20:05:15 +11:00
Michael Gratton
fac257a273 Merge branch 'mjog/558-webkit-shared-process-redux' into 'mainline'
Webkit shared process redux

See merge request GNOME/geary!565
2020-10-13 08:27:01 +00:00
Michael Gratton
2357f8fd01 Merge branch 'mjog/default-development-build' into 'mainline'
Set default build profile to development

See merge request GNOME/geary!597
2020-10-13 08:00:26 +00:00
Michael Gratton
1d80ed2034 ComposerPageState: Use CSS for managing focus with composer body parts
Now that the `:focus-within` pseudoclass is supported, use this rather
than some custom JS to update custom HTML classes. This also prevents
spurious mutation events from firing.
2020-10-13 00:02:09 +11:00
Michael Gratton
0609fbc3d7 Util.JS: Remove now-unused code 2020-10-13 00:02:09 +11:00
Michael Gratton
89453931bf Util.Js: Improve JSC Value to GLib.Variant conversion
Stop needlessly wrapping object members and array elements in
variant variants.

Don't wrap object values in variants since the code is already using
vardicts for these. Return a variant array if a JS array contains values
of all the same type and don't wrap these in variants, else return
a tuple, which don't need to be wrapped either.
2020-10-13 00:02:09 +11:00
Michael Gratton
c813aa5707 Components.WebView: Check for pass up exceptions when calling JS code
Update web extension to check for errors when invoking page state
methods and pass a message back if found. Check for this, decode and
throw a vala error in the WebView if found.
2020-10-13 00:02:09 +11:00
Michael Gratton
ff565bc6ef Components.WebView: Convert to using messages for JS method invocation
Use WebKitGTK UserMessage objects for invoking JS methods rather than
serialising to JS strings and running those. This is possibly slightly
less efficient, but removes the onus on serialising to and parsing from
JS and once switched over from message handlers to UserMessage objects
will be using a single uniform IPC interface for both.
2020-10-13 00:02:09 +11:00
Michael Gratton
1ba2bd0f5b Util.JS: Support converting between JSC.Value and GLib.Variant objects
Add `variant_to_value` and `value_to_variant` methods, document them
and add tests.
2020-10-13 00:02:09 +11:00
Michael James Gratton
d7af23201c Revert "Revert "Merge branch 'mjog/558-webkit-shared-process' into 'mainline'""
This reverts commit cbe6e0ba9b, which reinstates
commit e4a5b85698.

See !411 and !374
2020-10-13 00:02:02 +11:00
Michael Gratton
aaa2934acf meson_options.txt: Update to use meson best practices and clean up
Convert to use meson features for features. Reorganise and rename
options for consistency. Make descriptions a bit less redundant.
2020-10-03 23:34:31 +10:00
Michael Gratton
03f05c6448 Merge branch 'mjog/986-namespace-assert' into 'mainline'
Disconnect from IMAP client sessions when logging out

Closes #986

See merge request GNOME/geary!586
2020-10-01 23:09:53 +00:00
Michael Gratton
bd85c4f1a8 Composer.Widget: Fix criticals when "mailto:" has empty body 2020-09-27 19:57:52 +10:00
Michael Gratton
41be8693d4 Geary.Imap.ClientSession: Treat logout as disconnect
Convert `get_protocol_state` to an automatic property, so that rather
than requiring explcit signals for lifecycle events, a GObject notify
signal can be used instead.

Convert disconnect signal to a property so it can be accessed if needed.

Convert code listening to the disconnect signal to listen to notify
signals for `protocol_state` instead, and hence also treat the session
as disconnected when a logout is in progress.

Fixes #986
2020-09-27 17:38:10 +10:00
Michael Gratton
85e9046c71 Geary.Imap: Make command cancellable a property of the command object
Since both submitting a command no longer requires a cancellable, and it
is desirable to avoid sending a queued command that has already been
cancelled beforehand, add a new `Command.should_send` Cancellable
property to specify if a command should (still) be sent or not, and stop
passing a cancellable to ClientSession when submitting commands.

Allow call sites to pass in existing cancellable objects, and thus also
add it it as a ctor property to the Command class and all subclasses.

Lastly, throw a cancelled exception in `wait_until_complete` if send
was cancelled so that the caller knows what happened.

Remove redundant cancellable argument from
`Imap.Client.command_transaction_async` and rename it to
`submit_command` to make it more obvious about what it does.
2020-09-02 14:34:41 +10:00
Michael Gratton
87340a9675 Merge branch 'mjog/955-special-use-unavailable-at-startup' into 'mainline'
Geary.Account.Information: Fix special use folder not correctly stored

See merge request GNOME/geary!569
2020-08-31 04:17:32 +00:00
Michael Gratton
39f687fcd3 Geary.Account.Information: Fix special use folder not correctly stored
The special use map needs custom hash and equality functions to
work correctly. Add these and some unit tests.

See #995
2020-08-30 18:26:26 +10:00
Michael Gratton
a64412e696 RFC822MesageTest: Fix locale-sensitive test case
Use `ascii_down()` instead of `down()` so the test case is more robust
in the face of being run under different locales.

Fixes #950
2020-08-29 18:33:15 +10:00
Michael Gratton
710eeb1e65 Merge branch '937-retain-messages-during-gc' into 'mainline'
Retain a number of messages when performing GC

Closes #937

See merge request GNOME/geary!556
2020-08-26 22:07:50 +00:00
Michael Gratton
964b03c068 Application.TlsDatabase: Add unit tests for local (non-GCR) pinning
Make the class internal so it can be tested, add unit tests covering
both in-memory-only and on-disk pinning.
2020-08-25 16:40:08 +10:00
Chris Heywood
4fdaaeacd9 Fix bug with message retention count during GC plus fix test case 2020-08-24 19:29:44 +10:00
Michael Gratton
3ddce74844 sql: Add db migration to clean up message_ids with extra whitespace 2020-08-23 12:58:17 +10:00
Michael Gratton
eb3a8b0fe4 Geary.RFC822.MessageID: Replace GMime parser with more lax parser
Support parsing message IDs with the form `<add-spec>` (per the RFC)
but also `(add-spec)` and `add-spec`.

Add unit tests.
2020-08-22 16:23:07 +10:00