aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/database-private.h2
-rw-r--r--lib/database.cc9
-rw-r--r--lib/message.cc2
-rw-r--r--lib/notmuch.h6
4 files changed, 17 insertions, 2 deletions
diff --git a/lib/database-private.h b/lib/database-private.h
index e42b8bb8..81097509 100644
--- a/lib/database-private.h
+++ b/lib/database-private.h
@@ -51,7 +51,7 @@ struct _notmuch_database {
Xapian::QueryParser *query_parser;
Xapian::TermGenerator *term_gen;
Xapian::ValueRangeProcessor *value_range_processor;
-
+ notmuch_bool_t maildir_sync;
};
/* Convert tags from Xapian internal format to notmuch format.
diff --git a/lib/database.cc b/lib/database.cc
index 380bbe3d..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)
{
diff --git a/lib/message.cc b/lib/message.cc
index 1548076d..c2a9ebdf 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -624,7 +624,7 @@ _notmuch_message_sync (notmuch_message_t *message)
if (message->notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY)
return;
- if (// todo_sync_enabled &&
+ if (message->notmuch->maildir_sync &&
!notmuch_message_get_flag(message, NOTMUCH_MESSAGE_FLAG_TAGS_INVALID)) {
status = _notmuch_message_tags_to_maildir (message);
if (status != NOTMUCH_PRIVATE_STATUS_SUCCESS) {
diff --git a/lib/notmuch.h b/lib/notmuch.h
index fe01e732..41820b59 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -176,6 +176,12 @@ notmuch_database_open (const char *path,
void
notmuch_database_close (notmuch_database_t *database);
+/* Sets whether maildir flags should be synchronized with notmuch
+ * tags. */
+void
+notmuch_database_set_maildir_sync (notmuch_database_t *database,
+ notmuch_bool_t maildir_sync);
+
/* Return the database path of the given database.
*
* The return value is a string owned by notmuch so should not be