X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=293d21aa01ff70c03ecdcbe3221c92dca21247f5;hb=4cfb2a02778bac16e785bbea1fd6c665e34bd955;hp=7a00917ec709ce3f7b30fff2699b993d2860840c;hpb=b65a783195cb459a316370eb7a956b6029102f2e;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index 7a00917e..293d21aa 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -688,6 +688,8 @@ notmuch_database_open (const char *path, notmuch = NULL; } + notmuch_database_set_maildir_sync (notmuch, FALSE); + DONE: if (notmuch_path) free (notmuch_path); @@ -717,6 +719,13 @@ notmuch_database_close (notmuch_database_t *notmuch) talloc_free (notmuch); } +void +notmuch_database_set_maildir_sync (notmuch_database_t *database, + notmuch_bool_t maildir_sync) +{ + database->maildir_sync = maildir_sync; +} + const char * notmuch_database_get_path (notmuch_database_t *notmuch) { @@ -1642,6 +1651,13 @@ notmuch_database_add_message (notmuch_database_t *notmuch, _notmuch_message_add_filename (message, filename); + /* This is a new message or it has a new filename and as such, + * its tags in database either do not exists or might be out + * of date. We assign the tags later in notmuch new, but until + * then we should not synchronize the tags back to the maildir + * flags (if notmuch is configured to do so). */ + notmuch_message_set_flag(message, NOTMUCH_MESSAGE_FLAG_TAGS_INVALID, TRUE); + /* Is this a newly created message object? */ if (private_status == NOTMUCH_PRIVATE_STATUS_NO_DOCUMENT_FOUND) { _notmuch_message_add_term (message, "type", "mail");