]> git.notmuchmail.org Git - notmuch/blobdiff - lib/config.cc
lib/config: add known config key "show.extra_headers"
[notmuch] / lib / config.cc
index 8f6ef110788fe174def7c9014ad6be2cba3eff9c..003ce6795c16602b6ed8173e48e14b04c5ae69b1 100644 (file)
@@ -596,6 +596,8 @@ _notmuch_config_key_to_string (notmuch_config_key_t key)
        return "user.name";
     case NOTMUCH_CONFIG_AUTOCOMMIT:
        return "database.autocommit";
+    case NOTMUCH_CONFIG_EXTRA_HEADERS:
+       return "show.extra_headers";
     default:
        return NULL;
     }
@@ -643,6 +645,7 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
        return "";
     case NOTMUCH_CONFIG_AUTOCOMMIT:
        return "8000";
+    case NOTMUCH_CONFIG_EXTRA_HEADERS:
     case NOTMUCH_CONFIG_HOOK_DIR:
     case NOTMUCH_CONFIG_BACKUP_DIR:
     case NOTMUCH_CONFIG_OTHER_EMAIL:
@@ -657,6 +660,7 @@ notmuch_status_t
 _notmuch_config_load_defaults (notmuch_database_t *notmuch)
 {
     notmuch_config_key_t key;
+    notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
 
     if (notmuch->config == NULL)
        notmuch->config = _notmuch_string_map_create (notmuch);
@@ -669,11 +673,14 @@ _notmuch_config_load_defaults (notmuch_database_t *notmuch)
 
        val = _notmuch_string_map_get (notmuch->config, key_string);
        if (! val) {
+           if (key == NOTMUCH_CONFIG_MAIL_ROOT && (notmuch->params & NOTMUCH_PARAM_SPLIT))
+               status = NOTMUCH_STATUS_NO_MAIL_ROOT;
+
            _notmuch_string_map_set (notmuch->config, key_string, _notmuch_config_default (notmuch,
                                                                                           key));
        }
     }
-    return NOTMUCH_STATUS_SUCCESS;
+    return status;
 }
 
 const char *