Try to avoid multi-threaded operations with Xapian.
This remove the thread workers during indexing, and avoids the indexing
background thread. So, mu4e has to wait once again during indexing.
We can improve upon that, but first we need to know if it avoids the
problem of issue #2756.
It's better to _not_ have auto-saves for your draft directory, but if
you do, ignore them at least in mu.
It may still trip up mbsync and friends, but not much we can do about
that.
Clean up the implementation a bit as well.
In Mu::parse_date_time, when provided with an empty string, return
time_t_max instead of G_MAXINT64. For systems with a 64-bit time_t, there
is no difference. With a 32-bit time_t it caused a test to fail:
not ok /utils/date-basic - ERROR:../mu-1.12.4/lib/utils/tests/test-utils.cc:92
void test_date_basic(): assertion failed
(parse_date_time(std::get<0>(test), std::get<1>(test)).value_or(-1)
== std::get<2>(test)): (18446744073709551615 == 2147483647)
This edge case probably only affected the test, as when other parts of
the application call parse_date_time (e.g. mu-server.cc and
mu-query-processor.cc), they check if the input string is empty first.
Add store::consume_message, which is like add message but std::move from
the caller such that the messages longer has copies (with
Xapian::Document) on the caller side; this is to avoid threading issues.
Seems journal logging fails on NetBSD (no surprise), but has some
unwanted/not-fully-understood side-effects.
In any case, outside Linux there's no use in even trying to use
journald; so we don't do that anymore.
Add conditional support for syslog (requires glib 2.80).
According to the readdir(2) man-page, not all file-systems support returning the
entry's file-type in `d_type`. For example, the reprotest reproducibility tool,
uses the disorderfs FUSE file-system to shuffle the order in which directory
entries are returned, and this does not set `d_type`. Therefore, in addition to
entries with type `DT_DIR` and `DT_LNK`, also process entries with type
`DT_UNKNOWN`.
Signed-off-by: Jeremy Sowden <azazel@debian.org>
Only include xapian.h in one place, so we can have consistent options.
With that in place, we can enable C++ move semantics.
We don't do anything with that yet, but we check in the meson.build file
to see if we have the required xapian version.
In musl, `stdout` is a macro that expands to `(stdout)`, and
`::(stdout)` is not valid C++.
../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected
id-expression before '(' token
268 | ::stdout);
| ^~~~~~
Nothing in the Mu namespace is named stdout, so it is safe to drop
the `::`.
Bug: https://bugs.gentoo.org/928361
Flag message that merely have a List-Unsubscribe header with
Flags::MailingList too (some marketing message have this header, yet
miss "List-Id".
Add a test as well.