]> git.cworth.org Git - obsolete/notmuch-old/blobdiff - lib/message.cc
lib: Document that absence of maildir flags can also remove/add tags
[obsolete/notmuch-old] / lib / message.cc
index ee52672a6ca5e1c1d514a31bb63271ac03725baa..39036ecca5516a4a7bc6f896f686a62d89d503c6 100644 (file)
@@ -998,14 +998,19 @@ notmuch_message_tags_to_maildir_flags (notmuch_message_t *message)
     strcpy (filename_new+(p-filename)+3, flags);
 
     if (strcmp (filename, filename_new) != 0) {
+       notmuch_status_t status;
+
        ret = rename (filename, filename_new);
        if (ret == -1) {
            perror (talloc_asprintf (message, "rename of %s to %s failed",
                                     filename, filename_new));
            exit (1);
        }
-       return _notmuch_message_rename (message, filename_new);
-       /* _notmuch_message_sync is our caller. Do not call it here. */
+       status = _notmuch_message_rename (message, filename_new);
+
+       _notmuch_message_sync (message);
+
+       return status;
     }
     return NOTMUCH_STATUS_SUCCESS;
 }