Commit Graph

697 Commits

Author SHA1 Message Date
Dirk-Jan C. Binnema 98abcf8e84 store: support in-memory database
For testing, this is faster / and doesn't pollute the file system.
2021-02-16 19:32:15 +02:00
Dirk-Jan C. Binnema 98a742e5e5 query: honor maxnum in threaded searches 2021-02-15 22:45:33 +02:00
Dirk-Jan C. Binnema 45655da948 mu-msg-file: calculate sha1 for messages
And use this to generate a message-id for messages that do not have one.
2021-02-15 22:29:38 +02:00
Dirk-Jan C. Binnema 108a33f16e query: avoid expected warning
Remove some debug leftover.
2021-02-15 21:43:47 +02:00
Dirk-Jan C. Binnema 579f841bdd query: filter out docs without query-matches
This avoid including unwanted messages in threaded results.
Also some cleanups.
2021-02-15 19:11:22 +02:00
Dirk-Jan C. Binnema bba8af8d51 mu-query: tweaks threaded/threaded querying 2021-02-13 00:48:07 +02:00
Dirk-Jan C. Binnema 50511a7460 mu-query: update deciders (avoid warning)
Don't report non-warning.
2021-02-12 23:48:02 +02:00
Dirk-Jan C. Binnema ffc809a01e query: improve thread-key-maker
For threading, we still get the _full_ set of messages (since the mset is
limited, but not the enquire); so no need to warn about docids we
haven't seen before.

Also, ensure the unwanted docids are sorted after the wanted ones.

Fixes: #1926.
2021-02-12 19:14:37 +02:00
Dirk-Jan C. Binnema 7a70942e67 build: experimental support for the meson build system 2021-02-12 00:49:35 +02:00
Dirk-Jan C. Binnema a3c6e74869 lib: replace some #define with constexpr
minor cleanup.
2021-02-11 18:54:25 +02:00
Dirk-Jan C. Binnema 936fd3f485 mu-query: sort "related" input by date
When doing 'related' searches, sort the initial (bounded) query results
by date, so we get the newest (or oldest)
2021-02-10 22:04:42 +02:00
Dirk-Jan C. Binnema 6ff9829ce1 lib: improve threaded sorting
Improve threaded sorting:
- rework the recursive algo (which should a crash noted earlier)
- sort by thread key (as in 1.5.7)

Fixes: #1923
Fixes: #1922
Fixes: #1911
Fixes: #1916
2021-02-10 12:35:19 +02:00
Dirk-Jan C. Binnema ba895bc65e mu-query-result: detect thread-subjects
Ongoing... try to determine the thread-subject, to be used in mu4e
later.
2021-01-29 22:44:45 +02:00
Dirk-Jan C. Binnema fdcbc5257d query-match-deciders: mark as leader / related
So we can use that as metadata later
2021-01-29 22:41:59 +02:00
Dirk-Jan C. Binnema ad86e2c4fc mu-contacts: cosmetic 2021-01-29 22:41:12 +02:00
Dirk-Jan C. Binnema 72fdfec3eb lib: clean up mu_msg_to_sexp API
move out the QueryMatch
2021-01-29 22:39:21 +02:00
Dirk-Jan C. Binnema e5a52e45fd mu-threads: improve sorting, duplicate handling
And add some more tests.
2021-01-27 22:28:58 +02:00
Dirk-Jan C. Binnema 7f70149c95 threads: don't assert on remove_child
Investigate this, seems to hit in the wild.
2021-01-25 21:44:02 +02:00
Dirk-Jan C. Binnema 3e64fdfb0f threads: avoid assert
The assert failure was spotted in the wild... we need to investigate,
but we can ignore it now to avoid SIGABRT.
2021-01-25 18:11:50 +02:00
Dirk-Jan C. Binnema 086999c2d1 query: in related/threaded mode, search all
In the related query, search _all_ messages, not just the amount asked;
this increases the chance of full threads.
2021-01-25 10:12:48 +02:00
Dirk-Jan C. Binnema cec25d3166 query: fix some typos 2021-01-25 10:11:46 +02:00
Dirk-Jan C. Binnema 01db0a4269
Merge pull request #1910 from rhgg2/contact-less-than-antisymmetric
Make order relation on contacts antisymmetric
2021-01-23 10:57:33 +02:00
Dirk-Jan C. Binnema 451fa65ffb build: fix compiler flags 2021-01-23 01:00:47 +02:00
Richard Garner f65bb4196c Make order relation on contacts antisymmetric 2021-01-23 09:07:35 +11:00
Dirk-Jan C. Binnema 3db19ce92b mu-msg-sexp: Improve list-post regexp
This should catch some more addresses.

Fixes: #1909.
2021-01-22 23:24:53 +02:00
Dirk-Jan C. Binnema 035a10ab49 remove obsolete threading tests 2021-01-22 23:24:53 +02:00
Dirk-Jan C. Binnema 98744c66f7 remove some dead code 2021-01-22 23:24:53 +02:00
Dirk-Jan C. Binnema 36684c9e97 mu: use sha-1 for fallback msgid
We were using a hash based on the path, but it's better to have
something that's constant even if the path chnages.
2021-01-22 22:53:35 +02:00
Dirk-Jan C. Binnema af386824f2 contacts: remove some dead code 2021-01-22 22:53:35 +02:00
Dirk-Jan C. Binnema fb34824232 contacts: only sort recent contacts by recency
Fixes: #1857
2021-01-22 22:51:33 +02:00
Dirk-Jan C. Binnema e282d80bc0 lib: Update for new querying machinery
Port to c++ and use new APIs.
2021-01-22 22:51:33 +02:00
Dirk-Jan C. Binnema 95dffb98a6 query: Rework querying/threading machinery
Rewrite the query machinery in c++:
- use an MSet decorator instead of the mu-msg-iter stuff
- use mu-query-decider to mark duplicates/unreadable/related messages
- use mu-query-threader to replace the older container/thread code

Algorithm did not substantially change, but the implementation details
did.
2021-01-20 14:09:04 +02:00
Dirk-Jan C. Binnema a3865d6ba9 index: wait with cleanup until work-queue is empty 2021-01-15 21:07:38 +02:00
Dirk-Jan C. Binnema 0ebf456612 lib: comment out some future unit test
Don't break the build!
2020-12-05 12:20:19 +02:00
Dirk-Jan C. Binnema ecafe54c99 parser: restore most unit tests 2020-12-05 11:42:54 +02:00
Dirk-Jan C. Binnema 3010e614a3 parser: using correct field for regexp expansion
Fixes: #1848
2020-12-05 11:42:54 +02:00
Dirk-Jan C. Binnema d0e357c150 utils: Improve option/result types
And add the beginnings of unit tests.
2020-11-28 10:46:38 +02:00
Dirk-Jan C. Binnema 4b6d9a0ce8 utils: add RAII stopwatch
For benchmarking
2020-11-28 10:46:38 +02:00
Evan Klitzke bd2fe50a74
use readdir(3) instead of deprecated readdir_r(3) in mu-maildir.c 2020-11-15 12:46:59 -08:00
Dirk-Jan C. Binnema 7d6475758c scripts: using GUILE_BINARY from configure
I.e., do not hard-code guile-2.2, it may be guile-3.0 instead.
2020-11-15 17:20:52 +02:00
Dirk-Jan C. Binnema c8b507f826 mu: remove obsolete MU_FEATURE_CRYPTO 2020-11-15 17:20:52 +02:00
Dirk-Jan C. Binnema 3f4e0cff62 mu-indexer: clean up state management 2020-11-15 17:20:52 +02:00
Dirk-Jan C. Binnema 558add3843 mu-msg: cosmetic 2020-11-15 17:20:52 +02:00
Dirk-Jan C. Binnema 702a1d8452 utils: add Result / Option types
Add some Rust-style Result/Option types, based on TartanLlama's
expected, optional classes.

There's std::optional of course, but we can't depend on C++17 yet.
2020-11-15 17:20:52 +02:00
Dirk-Jan C. Binnema a1d1619bda use c++ for some more sources
Do a (superficial) port to c++ of some of the c sources. Update
deps. Fix a few compiler warnings.
2020-11-07 14:11:59 +02:00
Dirk-Jan C. Binnema f7452761cb index: improve error handling 2020-11-07 11:43:11 +02:00
Dirk-Jan C. Binnema 26c1b9b6ad lib: remove unused json conversion
We no longer use the glib-json based impl.
2020-11-07 11:43:11 +02:00
Dirk-Jan C. Binnema c7a874b8d6 lib: convert threader/container to c++
Did change the code much, but it's now compiled as c++
2020-11-07 11:43:11 +02:00
Dirk-Jan C. Binnema ed4a640c39 lib/query: refactor & rework
- Move the lib/query/ stuff up a level into lib/
- Associate directly with the Query object
- Rework the Query object to be C++ rather than mixed with C
- Update all dependencies, tests
2020-11-04 23:35:30 +02:00
Dirk-Jan C. Binnema 2135844e1b fix some compiler warnings 2020-11-01 14:25:25 +02:00
Dirk-Jan C. Binnema 6b8ccff572 guile: avoid need for muldef 2020-11-01 14:04:15 +02:00
Dirk-Jan C. Binnema 72d9dba7cc lib/maildir: log when move-source still exists
Instead of raising an error... it *seems* this could happen with some mail
sync programs.
2020-11-01 14:04:15 +02:00
Dirk-Jan C. Binnema 812b5c3e65 server: improve help output 2020-11-01 14:04:15 +02:00
Dirk-Jan C. Binnema 69b157a346 lib: improve error handling, cleanups 2020-10-31 09:46:13 +02:00
Dirk-Jan C. Binnema aea64c4a08 mu/lib: refactor mu(-cmd)-server code
Split off the parsing/handling code from the mu command server into
mu-server, and only leave the external interface (the mu4e repl) in
mu-cmd-server.
2020-10-31 09:46:13 +02:00
Dirk-Jan C. Binnema d2aa1f91b0 mu: support json output directly
Allow for dumping json directly from the Sexp structures, so we don't
need any external libs (i.e. json-glib) anymore.
2020-10-26 18:39:56 +02:00
Dirk-Jan C. Binnema c223f858b7 mu4e: Add some extra logging to the mu-maildir 2020-10-22 20:16:41 +03:00
Dirk-Jan C. Binnema 2eb8fc82ad lib: fix 'personal' handling in contacts 2020-10-18 11:58:32 +03:00
Dirk-Jan C. Binnema dbff5671dd lib: support 'personal' regexp, move to mu-contacts
Move the determination of "personal" to MuContacts; add support for
regexps (POSIX-basic, in //)
2020-10-17 10:36:25 +03:00
Dirk-Jan C. Binnema 5cd6226ebd
Merge pull request #1813 from juanjosegarciaripoll/fix-renaming-separator
mu_maildir_get_new_path() did not use the right flags separator
2020-10-16 21:35:35 +03:00
Juan Jose Garcia-Ripoll fbad4760a4 Emacs did not use tabs in indenting mu-maildir.c 2020-10-16 19:34:55 +02:00
Juan Jose Garcia-Ripoll dd14ba64dd Fixed indentation and name / type conventions to match original 2020-10-16 19:22:52 +02:00
Dirk-Jan C. Binnema 9995d28927 mu: indexer: update dirstamp with statbuf st_mtime 2020-10-14 00:09:32 +03:00
Juan Jose Garcia-Ripoll e47c1f4f28 mu_maildir_get_new_path() did not use the right flags separator when creating new file names. 2020-10-10 18:20:16 +02:00
Juan Jose Garcia-Ripoll c885df06a1 Use g_stat() instead of stat() with GStatBuf 2020-10-02 09:51:33 +02:00
Dirk-Jan C. Binnema a4d6302dab mu-sexp: use std::vector instead of std::deque
Using deque gives compilation errors when compiling on
MacOS/clang (where it defaults to libc++ rather than gcc's libstdc++)

```
 #include <deque>
 struct Foo { std::deque<Foo> foos; };
 int  main() { Foo foo; }
```

So, let's use a vector instead; this is a drop-in replacement here, but
unfortunately in some future code...
2020-08-15 10:39:14 +03:00
Dirk-Jan C. Binnema 3691e28316 build: attempt to avoid some libc++ problems
Seems there are problems compiling mu with XCode 11.6 (see build tests);
apparently because of libc++ being different from libstdc++.

clang++ builds works fine as long as we're using libstdc++.
2020-07-26 11:56:25 +03:00
Jonas Bernoulli b711ad9151 Fix typos 2020-07-25 16:46:47 +02:00
Dirk-Jan C. Binnema 148c906d8a fix compilation error / clang warnings 2020-07-25 11:26:08 +03:00
Dirk-Jan C. Binnema 6cea9fcd71 mu-msg-sexp: Use list for list-post property
And some small cleanups.
2020-07-13 21:59:46 +03:00
Dirk-Jan C. Binnema 2588aaeb9e
Merge pull request #1759 from damon-kwok/fixed-missing-includes
[MSYS2] Added missing include files
2020-07-13 21:50:15 +03:00
Dirk-Jan C. Binnema 19c1c6cfd4 lib/mu-msg: Update for Sexp changes 2020-07-13 21:43:59 +03:00
Dirk-Jan C. Binnema 31dd4e2104 utils/sexp: Clean up API and implementation
Also update the tests and command-parser.
2020-07-13 21:43:59 +03:00
damon-kwok 689fd60181 Added missing include files 2020-07-13 15:02:18 +08:00
Alex Bennée f40178fe8a lib/index: fix deadlock when mu4e-index-cleanup is nil (#1749)
If the user has wants to postpone clean-up we shouldn't lock the
indexer waiting for something that will never happen. Clear the flag
event though we are actually skipping cleanup.
2020-07-06 20:49:04 +01:00
Todd Carson 73603c97e2 Don't declare mu_str_size_s() with the const attribute.
When this function is declared const or pure, clang at -O1 or higher optimizes
away the call to mu_str_size_s() inside mu_str_size(), so that it ignores its
argument and returns whatever is in mu_str_size_s()'s static buffer.

Found when test-mu-str failed while testing an update of mu in OpenBSD's ports tree.
2020-07-01 00:16:19 +09:00
Dirk-Jan C. Binnema 556b898e4d lib: Remove unused file 2020-06-28 13:23:56 +03:00
Dirk-Jan C. Binnema c8eff488ba cosmetics 2020-06-27 17:07:00 +03:00
Dirk-Jan C. Binnema 4617935d80 store: Update for the new indexer
Update some APIs so we can use it with the new indexer.

Remove some now-obsolete C APIs.
2020-06-27 17:07:00 +03:00
Dirk-Jan C. Binnema 4e6bd7dfdf lib/index: Implement new indexer
Implement a new message indexer consisting of a single-threaded scanner
and a multi-threaded indexer.

This allows for a number of optimizations as well as background
indexing, though this initial version should be behave similar to the
old indexer.
2020-06-27 17:07:00 +03:00
Dirk-Jan C. Binnema f416ad4249 utils: Add async-queue
Like GAsyncQueue, but for c++
2020-06-27 17:07:00 +03:00
Dirk-Jan C. Binnema 1b056f4c51 utils: Add Mu::canonicalize_filename
We need it for unit-tests
2020-06-27 17:07:00 +03:00
Dirk-Jan C. Binnema 6061898c2b utils: Clean up duration helpers 2020-06-27 17:07:00 +03:00
Dirk-Jan C. Binnema 5922cd9fa2 lib/mu-msg: benchmark message creation 2020-06-26 19:26:45 +03:00
Dirk-Jan C. Binnema 73f4c49364 utils: add async-queue, ansio-printer
Add an async-queue (rougly, GAsyncQueue but in c++ using a deque)

Add an ANSI color printer.
2020-06-26 19:21:04 +03:00
Dirk-Jan C. Binnema 9762b1bc3b utils/command-parser: Make property key ":" prefix explicit
Avoid a bit of 'magic' so we can catch missing ':' in property :keys
easier.
2020-06-13 16:56:41 +03:00
Dirk-Jan C. Binnema 981c781425 store: add bit more debug-logging 2020-06-13 16:56:41 +03:00
Dirk-Jan C. Binnema cf2e4f1dcd lib/mu-msg: cosmetic 2020-06-13 16:56:41 +03:00
Dirk-Jan C. Binnema fe6582c6d6 lib: implement mu_store_update 2020-06-13 16:56:41 +03:00
Dirk-Jan C. Binnema a9fab4abcc mu: convert command-line tools to c++ 2020-06-13 16:56:41 +03:00
Dirk-Jan C. Binnema 6a7449c7e3 mu-msg-sexp: correctly mask date/time bits
Typo fix.
2020-06-10 21:50:23 +03:00
Dirk-Jan C. Binnema 2f8850ea86 utils/sexp: add a bit more convenience 2020-06-09 19:52:03 +03:00
Dirk-Jan C. Binnema b10b243b54 lib/utils: update unit test 2020-06-07 18:11:41 +03:00
Dirk-Jan C. Binnema 452f62f5c0 lib: update msg->sexp to use programmatic s-expressions
Use the new mu-sexp capabilities.
2020-06-06 14:27:25 +03:00
Dirk-Jan C. Binnema 3afdc08d50 lib/utils: build s-expression programmatically building
Allow for programmatically buildings sexps, rather that using raw
strings.
2020-06-06 14:27:25 +03:00
Dirk-Jan C. Binnema 4dd764d9e8 lib/utils: add mu-logger.{cc,hh}
They were missing.

Fixes #1713.
2020-05-30 18:33:27 +03:00
Dirk-Jan C. Binnema 3e233cba9a rework logging system
reimplement the old mu-log.[ch] into mu-logging.{cc,hh}

If available (and using an appropriately equipped glib), log to the
systemd journal

Only g_criticals have stderr output, all the other g_* go to the log
file / journal.
2020-05-30 13:29:44 +03:00
Dirk-Jan C. Binnema 0a49cead33 build: don't require glib 2.58 for g_canonicalize_file
GLib version is probably still a bit too new, so simply lift the
function needed.

Fixes: #1712.
2020-05-28 00:37:29 +03:00
Dirk-Jan C. Binnema 8bfcb7430b lib/mu-msg-file: Use canonical path instead of real path
For the new symlink-support, it's better to use the *canonical* path than
the *realpath(3)* for files, so removing a symlinked maildir will work as
expected.
2020-05-27 18:55:18 +03:00
Dirk-Jan C. Binnema fdac81e023 lib: follow symlinks in maildirs
Until now, mu would _not_ follow symlinks; with these changes, we do.

There were some complications with that ~10 years ago, but I forgot the
details. So let's re-enable. At least one thing is in place now: moving
between file systems.

Fixes #1489
Fixes #1628 (technically, this came with slightly earlier commit)
2020-05-26 19:22:41 +03:00