Commit Graph

697 Commits

Author SHA1 Message Date
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
Dirk-Jan C. Binnema 015fae7b1a guile: fix readline linking
For now, simply link muguile against readline; hopefully, we can make
this transitive.
2020-05-26 00:41:46 +03:00
Dirk-Jan C. Binnema 7e49f83c9f mu-maildir: attempt to allow moving to different fs
Add an EXDEV fallback for moving a file to a different filesystem.
2020-05-25 21:40:02 +03:00
Dirk-Jan C. Binnema f67b551460 mu-maildir: avoid unnecessarily moving new-name files
When calling mu_maildir_move_message with the new_name
options (workaround for mbsync's), do the src=target check *without* first
creating that new name.

This avoids some unnecessary moves.
2020-05-25 21:26:00 +03:00
Dirk-Jan C. Binnema 286225be8f
Merge pull request #1705 from nickg/windows-file-sep
Allow ';' as a Maildir flags seperator
2020-05-25 20:52:30 +03:00
Dirk-Jan C. Binnema b60cfc7df2 mu-server: restore readline-support
Restore readline support for `mu server' (but _only_ when readline is
found and when in tty mode)
2020-05-25 18:34:42 +03:00
Nick Gasson f8fcb55f91 Allow ';' as a Maildir flags seperator
Isync uses this by default on Windows where ':' is an invalid character
in file names. Also try to preserve the existing separator character
when generating a new file name.
2020-05-23 09:21:57 +08:00
Dirk-Jan C. Binnema 35db0f5906 mu-contacts: cosmetic 2020-05-17 14:53:18 +03:00
Dirk-Jan C. Binnema 53b553124c
Merge pull request #1663 from czan/master
mu: always sort descending within threads
2020-05-17 14:45:39 +03:00
Jonas Bernoulli 564d892701 Fix typos 2020-05-12 23:56:55 +02:00
Dirk-Jan C. Binnema f44f81b751 mu: don't verify signatures when it's not needed
We were verifying signatures when this was not needed; it seems that
gpgme is a bit slow (?), and on some people's machine the extra
verification made opening messages slow (with the non-gnus view esp.)
2020-05-05 21:25:36 +03:00
Kristian Rietveld c3032bd672 mu-store: enlarge buffer for strftime
On Debian 9 random memory was printed with the original buffer size
and valgrind complained about the use of uninitialized memory.
2020-05-01 20:47:45 +02:00
Dirk-Jan C. Binnema 7c3673b3de mu: do a full index when the database is empty
I.e., do _not_ honor .noupdate in that case.
2020-04-29 20:27:49 +03:00
Carlo Zancanaro 928dc5e0fc mu: always sort descending within threads 2020-04-29 10:55:19 +10:00
Dirk-Jan C. Binnema 06d3deb4cc guile: path updates for 2.2 2020-04-20 00:01:07 +03:00
Dominik Schrempf ccbd81f6ef ~/.mu -> ~/.cache/mu 2020-04-19 13:02:48 +02:00
Dirk-Jan C. Binnema a4fded5edd mu: ensure some struct members are initialized 2020-03-31 21:19:03 +03:00
Dirk-Jan C. Binnema 46ae663937 mu4e: use faster count queries, document differences
Use faster queries for counting read/unread messages; document why the
results might differ from what you get doing a normal search.
2020-03-15 01:23:01 +02:00
Dirk-Jan C. Binnema 49883806f6 store: remove unused code, use batchsize 2020-03-02 23:19:34 +02:00
Dirk-Jan C. Binnema a76720af42 make OP_WILDCARD non-conditional
Since we require Xapian 1.4 anyway, there's no need to make OP_WILDCARD
conditional.
2020-03-02 23:02:17 +02:00
damon-kwok 56b434347e error fix for gcc 9.x 2020-02-29 20:40:22 +08:00
Dirk-Jan C. Binnema 07e4a28deb man: remove max-msg-size from index man-page
We still keep in the code, as there are some future plans to handle it
there in a different way.

Fixes #1591.
2020-02-26 19:31:24 +02:00
Dirk-Jan C. Binnema 934adae70a lib: use same allocator when copying MuMsgPartSigStatusReport
Fixes a sigabrt when freeing later.
2020-02-23 15:20:01 +02:00
Dirk-Jan C. Binnema ac164b7e26 mu-command-parser: do not allow unknown parameters
We were simply ignoring unknown parameters; but it's better to raise an
error, as it's likely unintented (typo or otherwise)
2020-02-22 14:11:54 +02:00
Dirk-Jan C. Binnema 650c4c052d store: catch exceptions in dtor 2020-02-21 19:29:27 +02:00
Dirk-Jan C. Binnema ff79d2b7d3 msg-crypto: fix small leak 2020-02-21 19:29:27 +02:00
Dirk-Jan C. Binnema 8d6d151090 server: support readline history / persistence
When using readline, remember the last 50 commands; persist.
2020-02-21 01:17:23 +02:00
Dirk-Jan C. Binnema 20ce7b7066 lib/parser -> lib/query
And update the names to follow the mu- convention.
2020-02-20 21:53:48 +02:00
Dirk-Jan C. Binnema c4c56fa7f0 mu-store: auto-commit store in dtor 2020-02-17 22:29:44 +02:00
Dirk-Jan C. Binnema 0b4dee6996 mu-script: fix compiler warning 2020-02-17 21:45:21 +02:00
Dirk-Jan C. Binnema beb1b3199f mu-msg-part: clean up error paths
Ensure things get freed even when an error occurs.
2020-02-15 14:10:59 +02:00
Dirk-Jan C. Binnema c22eb434b7 mu: improve crypto handling 2020-02-14 00:36:54 +02:00
Julien Masson c4ccaf0fdb mu: sort childs of thread based on the sortfield only
Today when we query a find cmd with the `--threads` option, all the
childs of each thread are sorted according to their leader based on
the sortfield.

This patch change the way of how the childs of a thread are sorted.
The threads are still sorted according to their leader but all the
childs of each thread are now sorted based on the sortfield only.

Here is an example of what happened with the previous sorting:

Example with random kernel thread sorted by date:

[PATCH 0/4] drm/panel: jh057n0090: Add regulators and drop magic value in init
  ┣━▶[PATCH 1/4] MAINTAINERS: Add Purism mail alias as reviewer for their devkit's panel
  ┣━▶[PATCH 2/4] drm/panel: jh057n0090: Don't use magic constant
  ┣━▶[PATCH 3/4] dt-bindings: display/panel: jh057n0090: Document power supply properties
  ┗━▶[PATCH 4/4] drm/panel: jh057n0090: Add regulator support

If someone reply to one of these emails in the middle, this email
become the leader and the thread is displayed like this:

[PATCH 0/4] drm/panel: jh057n0090: Add regulators and drop magic value in init
  ┣━▶[PATCH 2/4] drm/panel: jh057n0090: Don't use magic constant
  ┃  ┗━▶ Re: [PATCH 2/4] drm/panel: jh057n0090: Don't use magic constant
  ┣━▶[PATCH 1/4] MAINTAINERS: Add Purism mail alias as reviewer for their devkit's panel
  ┣━▶[PATCH 3/4] dt-bindings: display/panel: jh057n0090: Document power supply properties
  ┗━▶[PATCH 4/4] drm/panel: jh057n0090: Add regulator support

With this patch, we will have the following output:

[PATCH 0/4] drm/panel: jh057n0090: Add regulators and drop magic value in init
  ┣━▶[PATCH 1/4] MAINTAINERS: Add Purism mail alias as reviewer for their devkit's panel
  ┣━▶[PATCH 2/4] drm/panel: jh057n0090: Don't use magic constant
  ┃  ┗━▶ Re: [PATCH 2/4] drm/panel: jh057n0090: Don't use magic constant
  ┣━▶[PATCH 3/4] dt-bindings: display/panel: jh057n0090: Document power supply properties
  ┗━▶[PATCH 4/4] drm/panel: jh057n0090: Add regulator support

The tests cases concerning threads have also been updated.

Signed-off-by: Julien Masson <massonju.eseo@gmail.com>
2020-02-10 15:42:39 +01:00
Dirk-Jan C. Binnema f50360f94e mu-store: implement Store::find_message 2020-02-10 01:00:42 +02:00
Dirk-Jan C. Binnema 24932c12b7 remove some dead code 2020-02-10 01:00:01 +02:00
Dirk-Jan C. Binnema aa10da0a63 store: rework to allow for 'init'
Rework the error handling / exception for read-only / writable and new
database.
2020-02-08 14:28:55 +02:00
Dirk-Jan C. Binnema f51846eefc mu: implement init, info commands
'init' is for the inital database setup

'info' is for gettting information about the mu database.
2020-02-08 14:28:55 +02:00
Dirk-Jan C. Binnema 2575b2d0e3 mu: better error handling for opening database read-only
Be a bit clearer for the user.
2020-02-04 21:14:30 +02:00
Dirk-Jan C. Binnema 38779cfade mu: no need to pass 'maildir' when we can deduce it
Only needed when setting up the database.
2020-02-04 01:05:35 +02:00
Dirk-Jan C. Binnema 1ea6f6a55e lib/utils: Add Message error. 2020-01-31 00:23:00 +02:00
Dirk-Jan C. Binnema e51240f43f mu: lib: update store API. update some dependents
Implement add_message / remove_message.

Rename path_tstamp ->  dirstamp.

Rename maildir -> root_maildir

Update dependents.
2020-01-31 00:20:34 +02:00
Dirk-Jan C. Binnema ba370f748c mu: sexp-parser: add support for negative numbers
We need those too!
2020-01-25 19:54:37 +02:00
Dirk-Jan C. Binnema f21ceea421 sexp-parser: improve error message 2020-01-25 19:31:20 +02:00
Dirk-Jan C. Binnema 7d83a1c5d6 server: improve command documentation output
required args come first, then alphabetic.
2020-01-25 11:51:38 +02:00
Dirk-Jan C. Binnema e119ac919b mu: fix clang compilation 2020-01-24 00:21:53 +02:00
Dirk-Jan C. Binnema 4b4e8dd6d7 utils/sexp-parser: include ostream 2020-01-23 23:17:00 +02:00
Dirk-Jan C. Binnema 6dcc712b51 msg-crypto: add support for more signature-status values 2020-01-22 21:02:17 +02:00
Dirk-Jan C. Binnema bdec1fe9c4 mu-query: implement mu_query_count_run
To get the number of matches and nothing else.
2020-01-22 11:42:15 +02:00
Dirk-Jan C. Binnema bb932fa217 mu: don't need a path argument for index
We get it from the store.
2020-01-22 11:42:15 +02:00
Dirk-Jan C. Binnema d2ec85f01c mu4e: use the new command-parser
Update mu4e-proc to use the new mu4e <-> mu protocol
2020-01-22 11:42:15 +02:00
Dirk-Jan C. Binnema c7680b78b9 utils: Implement sexp command parser
Implement a sexp parser, and on top of that a command parser (for mu4e
commands). Add tests, too.
2020-01-21 20:58:18 +02:00
Dirk-Jan C. Binnema 6818c7df6c mu-msg: plug some leaks 2020-01-19 17:33:32 +02:00
Dirk-Jan C. Binnema a3d71dab91 utils: Update error exception, utils. 2020-01-18 13:40:15 +02:00
Dirk-Jan C. Binnema e203e26a38 mu-sexp: improve list-post regexp
Support more addresses.
2020-01-08 23:23:13 +02:00
Dirk-Jan C. Binnema b2014fe93e use g_snprintf instead of snprintf
Seems the latter cannot be found on some platforms; perhaps a
c++/namespace thing?

Use g_snprintf instead.
2020-01-07 23:17:15 +02:00
Dirk-Jan C. Binnema 38a91f3696 mu: include list-post address in message sexp
If there's a list-post address, include it in the message-sexp, so we
can use it when replying.
2020-01-07 22:45:20 +02:00
Dirk-Jan C. Binnema f4874cd7e1 lib/utils: Update 2020-01-05 17:46:21 +02:00
Dirk-Jan C. Binnema 12b34be3cf mu: allow for code-coverage reports 2020-01-01 15:56:48 +02:00
Dirk-Jan C. Binnema ad63044915 mu: Fix some compiler warnings 2020-01-01 15:56:48 +02:00
Dirk-Jan C. Binnema 80c5e25b08 mu: move mu/mu/tests, lib/tests one level up
Makes it easier to generator code-coverage reports
2020-01-01 15:56:48 +02:00
Dirk-Jan C. Binnema 97afdd9e3c lib: Use Mu:Error exception
Where applicable.
2020-01-01 13:25:07 +02:00
Dirk-Jan C. Binnema dfafecaf0c utils: add Mu::Error (runtime exception) 2020-01-01 13:25:07 +02:00
Dirk-Jan C. Binnema b1d4c5af79 mu: fix list-post email regexp
'_' is valid in email addresses.

Fix courtesy of jaknel; fixes #1529.
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema 9f93526884 move parser/utils to utils, Mux->Mu
Move the parser utils to utils/ and rename the Mux namespace into Mu.
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema b55e191421 update for lib/utils split
Update sources with the new paths
2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema e5337e7658 lib: split out utils to lib/utils 2019-12-22 15:26:45 +02:00
Dirk-Jan C. Binnema 0c7831b5c9
Merge pull request #1511 from derekschrock/test-mu-maildir
lib: Allow hostname of newbase to match alnum
2019-11-17 14:20:17 +02:00
Derek Schrock 7d439928f5 lib: Use more portable locale en_US.UTF-8
On some systems (FreeBSD) en_US.utf8 doesn't exist.  Use a portable
locale en_US.UTF-8.
2019-11-16 23:01:18 -05:00
Derek Schrock 1585b933fb lib: Allow hostname of newbase to match alnum
Possible hostnames might have digits and - in them.  Crude regex to
allow hostnames that start with alnum followed by alnum or "-".

Fixes #1399
2019-11-16 22:59:04 -05:00
Dirk-Jan C. Binnema 0dab2b0faf
Merge pull request #1507 from tarsiiformes/typos
Fix typos
2019-11-09 13:06:23 +02:00
Alex Murray 5a450b1aee Treat text/markdown as plain text for issue #1503 2019-11-07 15:03:36 +10:30
Jonas Bernoulli f31d1b065d Fix typos 2019-11-06 16:13:39 +01:00
Yuri D'Elia b609080d77 Process personal flag when adding new contacts 2019-08-16 13:06:12 +02:00
Yuri D'Elia 230df78780 Avoid wrong type/warning in comparison 2019-08-16 11:50:40 +02:00
Yuri D'Elia b71b60704b Update internal cache in set_personal_addresses 2019-08-16 11:44:35 +02:00
Dirk-Jan C. Binnema 74f9f78ec0 lib: Don't use Xapian::DatabaseNotFoundError, it's too new
Xapian::DatabaseNotFoundError only arrived with Xapian 1.4.10.
2019-08-03 11:06:50 +03:00
Dirk-Jan C. Binnema 63b556da6d mu-util: fix warning 2019-08-01 22:44:03 +03:00
Dirk-Jan C. Binnema fc0ea805f5 mu-msg-fields: Mark contact fields as phrase-enabled 2019-08-01 22:11:39 +03:00
Dirk-Jan C. Binnema a8752e28c3 mu-store.hh: add it; it was missing 2019-07-31 17:19:23 +03:00
Dirk-Jan C. Binnema be4860befe tests: update for lib/mu-store changes 2019-07-30 08:51:04 +03:00
Dirk-Jan C. Binnema 83d6484f86 lib/mu-store: rework implementation
* mu-store.h, mu-store-read.cc, mu-store-write.cc, mu-store-priv.hh have been reworked
   in mu-store.{cc,hh}, it the mix of c/c++ improved
 * update all the dependent modules
 * make it easier to upgrade an database in place (without user intervention)
 * remove the xbatch-size option
2019-07-30 08:51:04 +03:00
Dirk-Jan C. Binnema b7cda29b96 mu-runtime: include string
Was missing, and breaks compilation in some environments.
2019-07-18 16:17:04 +03:00
Dirk-Jan C. Binnema 632f383c38 mu: Default to XDG Base Directory Specification
Instead of using ~/.mu, use the XDG Base Directory Specification, typically:
  ~/.cache/xapian
  ~/.cache/mu.log
  ~/.cache/parts
  ~/.config/bookmarks

Update dependencies, documentation.
2019-07-13 16:00:28 +03:00
Dirk-Jan C. Binnema 69229a4228 mu: remove contacts-path leftovers
The contacts are now embedded in the xapian database, so we don't need
the contact-path anymore. Let's remove some leftovers.
2019-07-13 13:43:57 +03:00
Dirk-Jan C. Binnema 125176d397 mu/lib: merge mu-contacts.h => mu-contacts.hh 2019-07-13 13:43:57 +03:00
Dirk-Jan C. Binnema 8ec8ab5380 mu-contacts: remove newlines from addresses
Seems gmime passes them on; and it causes havoc with our contacts cache.

Bump database schema version to force an rebuild (since that's what's
required.)
2019-07-11 23:30:27 +03:00
Dirk-Jan C. Binnema 5440747ba4 mu: require glib >= 2.38; remove g_type_init calls
Minor cleanup.
2019-07-11 23:30:27 +03:00
djcb dc271f4721 mu-contacts: fix some compiler warnings 2019-05-25 10:39:40 +03:00
djcb 9edcae0203 update store, msg for new contacts-cache handling 2019-05-11 13:41:03 +03:00
djcb bd52902290 contacts: update test cases for updated contacts
Remove the old ones, add new ones.
2019-05-11 13:41:03 +03:00
djcb 8193cc3e4c contacts: rework: install in database
Rewrite the contacts-cache backend in c++

Store the contacts as metadata in the xapian database, rather than in a
separate file.

Update the Store to deal with this.
2019-05-11 13:41:03 +03:00
Evan Klitzke 0cc94468b3
Fix pedantic -Wparentheses warning emitted by gcc 9.0 2019-05-06 07:58:37 -07:00
djcb 6e8378ddcd mu: update crypto verify test 2019-03-24 11:54:12 +02:00
djcb bc891030f6 mu: fix utf-8 flatten 2019-03-24 11:43:51 +02:00
djcb da10f30adf utils: small optimization in utf8_flatten
In the common path, avoid building an unneeded std::string. This should
up in some profiles.
2019-03-23 17:00:25 +02:00
djcb 9bffb465bd mu: don't include text attachments as part of body
It's somewhat nice in some case, but not generally so; so let's not do
it.
2019-02-18 08:30:55 +02:00
Dirk-Jan C. Binnema d41242ff6c
Merge pull request #1359 from OnkelUlla/fix_compiler_warnings
Fix compiler warnings
2019-01-17 22:26:50 +02:00
Dirk-Jan C. Binnema 0903eaba79
Merge pull request #1284 from nicolasavru/limit-threading-set
Perform threading calculation on related set instead of entire result.
2019-01-13 22:53:45 +02:00
Ulrich Ölmann d37a961c8f parser: fix clang-7.0.1 warnings
Without this commit clang++-7.0.1 whines

|   CXX      parser.lo
| parser.cc:138:15: warning: braces around scalar initializer [-Wbraced-scalar-init]
|         return Tree({{Node::Type::Range},
|                      ^~~~~~~~~~~~~~~~~~~
2019-01-11 06:49:01 +01:00
Ulrich Ölmann 493a9efa7a mu, tests: fix gcc-8.2.0 warnings
Without this commit gcc-8.2.0 whines

|   CC       mu-msg-json.lo
| mu-msg-json.c: In function ‘get_temp_file_maybe’:
| mu-msg-json.c:254:14: warning: unused variable ‘tmpfile’ [-Wunused-variable]
|   char *tmp, *tmpfile;
|               ^~~~~~~
| mu-msg-json.c:254:8: warning: unused variable ‘tmp’ [-Wunused-variable]
|   char *tmp, *tmpfile;
|         ^~~
| mu-msg-json.c: In function ‘add_part_crypto’:
| mu-msg-json.c:276:21: warning: unused variable ‘s’ [-Wunused-variable]
|   char    *signers, *s;
|                      ^
| mu-msg-json.c:276:11: warning: unused variable ‘signers’ [-Wunused-variable]
|   char    *signers, *s;
|            ^~~~~~~
| mu-msg-json.c: In function ‘each_part’:
| mu-msg-json.c:332:14: warning: variable ‘cid’ set but not used [-Wunused-but-set-variable]
|   const char *cid;
|               ^~~

and

|   CC       test-mu-str.o
| test-mu-str.c: In function ‘test_mu_str_subject_normalize’:
| test-mu-str.c:282:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "test123", "test123" },
|      ^~~~~~~~~
| test-mu-str.c:282:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "test123", "test123" },
|                 ^~~~~~~~~
| test-mu-str.c:283:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re:test123", "test123" },
|      ^~~~~~~~~~~~
| test-mu-str.c:283:19: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re:test123", "test123" },
|                    ^~~~~~~~~
| test-mu-str.c:284:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re: Fwd: test123", "test123" },
|      ^~~~~~~~~~~~~~~~~~
| test-mu-str.c:284:25: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re: Fwd: test123", "test123" },
|                          ^~~~~~~~~
| test-mu-str.c:285:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re[3]: Fwd: test123", "test123" },
|      ^~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:285:28: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "Re[3]: Fwd: test123", "test123" },
|                             ^~~~~~~~~
| test-mu-str.c:286:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "operation: mindcrime", "operation: mindcrime" }, /*...*/
|      ^~~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:286:29: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "operation: mindcrime", "operation: mindcrime" }, /*...*/
|                              ^~~~~~~~~~~~~~~~~~~~~~
| test-mu-str.c:287:5: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "", "" }
|      ^~
| test-mu-str.c:287:9: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
|    { "", "" }
|          ^~
2019-01-11 06:48:51 +01:00
djcb 53c1b0a069 mu: make attachment test a bit looser
Consider all 'inline' text parts attachments too, unless they're
'text/plain' or something that looks like a signature.

It's a heuristic so we might get some new corner-cases.. let's see.
2018-12-30 18:46:43 +02:00