]> git.notmuchmail.org Git - notmuch/blobdiff - lib/indexopts.c
indexing: Change from try_decrypt to decrypt
[notmuch] / lib / indexopts.c
index 51b56dd7924d5aef5d7a524eabb0cf5d91411fdf..ca6bf6c962ccddbe37e595e4c1d630ef8b302bd8 100644 (file)
 notmuch_indexopts_t *
 notmuch_database_get_default_indexopts (notmuch_database_t *db)
 {
-    return talloc_zero (db, notmuch_indexopts_t);
+    notmuch_indexopts_t *ret = talloc_zero (db, notmuch_indexopts_t);
+    if (!ret)
+       return ret;
+
+    char * decrypt;
+    notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt);
+    if (err)
+       return ret;
+
+    if (decrypt &&
+       ((!(strcasecmp(decrypt, "true"))) ||
+        (!(strcasecmp(decrypt, "yes"))) ||
+        (!(strcasecmp(decrypt, "1")))))
+       notmuch_indexopts_set_try_decrypt (ret, true);
+
+    free (decrypt);
+    return ret;
 }
 
 notmuch_status_t