]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message.cc
lib: actually return failures from notmuch_message_tags_to_maildir_flags
[notmuch] / lib / message.cc
index ed8c59e9b072795aec252b99def49a5d4b14e20e..7e825480ecc6e5782a93113e13b0e9730fac96fc 100644 (file)
@@ -655,6 +655,10 @@ _notmuch_message_add_filename (notmuch_message_t *message,
     if (filename == NULL)
        INTERNAL_ERROR ("Message filename cannot be NULL.");
 
+    if (! (message->notmuch->features & NOTMUCH_FEATURE_FILE_TERMS) ||
+       ! (message->notmuch->features & NOTMUCH_FEATURE_BOOL_FOLDER))
+       return NOTMUCH_STATUS_UPGRADE_REQUIRED;
+
     relative = _notmuch_database_relative_path (message->notmuch, filename);
 
     status = _notmuch_database_split_path (local, relative, &directory, NULL);
@@ -699,6 +703,10 @@ _notmuch_message_remove_filename (notmuch_message_t *message,
     notmuch_private_status_t private_status;
     notmuch_status_t status;
 
+    if (! (message->notmuch->features & NOTMUCH_FEATURE_FILE_TERMS) ||
+       ! (message->notmuch->features & NOTMUCH_FEATURE_BOOL_FOLDER))
+       return NOTMUCH_STATUS_UPGRADE_REQUIRED;
+
     status = _notmuch_database_filename_to_direntry (
        local, message->notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry);
     if (status || !direntry)
@@ -1489,7 +1497,7 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message)
     talloc_free (to_set);
     talloc_free (to_clear);
 
-    return NOTMUCH_STATUS_SUCCESS;
+    return status;
 }
 
 notmuch_status_t