- talloc_free (add_files_state.removed_files);
- talloc_free (add_files_state.removed_directories);
-
- /* Now that removals are done (hence the database is aware of all
- * renames), we can synchronize maildir_flags to tags for all
- * messages that had new filenames appear on this run. */
- gettimeofday (&tv_start, NULL);
- if (add_files_state.synchronize_flags) {
- _filename_node_t *node;
- notmuch_message_t *message;
- for (node = add_files_state.message_ids_to_sync->head, i = 0;
- node;
- node = node->next, i++)
- {
- message = notmuch_database_find_message (notmuch, node->filename);
- notmuch_message_maildir_flags_to_tags (message);
- notmuch_message_destroy (message);
- if (do_print_progress) {
- do_print_progress = 0;
- generic_print_progress (
- "Synchronized tags for", "messages",
- tv_start, i, add_files_state.message_ids_to_sync->count);
- }
+ for (f = add_files_state.directory_mtimes->head; f && !interrupted; f = f->next) {
+ notmuch_directory_t *directory;
+ directory = notmuch_database_get_directory (notmuch, f->filename);
+ if (directory) {
+ notmuch_directory_set_mtime (directory, f->mtime);
+ notmuch_directory_destroy (directory);