At indexing time, the database needs some way to know its internal
defaults for how to index encrypted parts.  It shouldn't be contingent
on an external config file (since that can't be retrieved from the
database object itself).

This behaves similarly to the query.* configurations, which are also
stored in the database itself, so we're not introducing any new
dependencies.

In some future series, it's conceivable that other indexing settings
(or all indexing settings) should be stored in the database, but for
the moment we'll just store/retrieve this one.
---
 notmuch-config.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/notmuch-config.c b/notmuch-config.c
index 8fb59f96..20e448f9 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -859,6 +859,8 @@ notmuch_config_command_get (notmuch_config_t *config, char 
*item)
                notmuch_built_with (item + strlen (BUILT_WITH_PREFIX)) ? "true" 
: "false");
     } else if (STRNCMP_LITERAL (item, QUERY_PREFIX) == 0) {
        return _print_db_config (config, item);
+    } else if (strcmp (item, "index.try_decrypt") == 0) {
+       return _print_db_config (config, item);
     } else {
        char **value;
        size_t i, length;
@@ -931,6 +933,9 @@ notmuch_config_command_set (notmuch_config_t *config, char 
*item, int argc, char
     if (STRNCMP_LITERAL (item, QUERY_PREFIX) == 0) {
        return _set_db_config (config, item, argc, argv);
     }
+    if (strcmp (item, "index.try_decrypt") == 0) {
+       return _set_db_config (config, item, argc, argv);
+    }
 
     if (_item_split (item, &group, &key))
        return 1;
-- 
2.14.2

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to