]> git.cworth.org Git - notmuch/blobdiff - lib/message.cc
lib: encapsulate the use of notmuch_database_t field 'mode'
[notmuch] / lib / message.cc
index 64798413d957d89c61ba8ed9f38b7b0025ae1c48..d23e64abaa06b4c1d3327f4bedd638e52dd5cf64 100644 (file)
@@ -275,7 +275,7 @@ _notmuch_message_create_for_message_id (notmuch_database_t *notmuch,
        return NULL;
     }
 
-    if (notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY)
+    if (_notmuch_database_mode (notmuch) == NOTMUCH_DATABASE_MODE_READ_ONLY)
        INTERNAL_ERROR ("Failure to ensure database is writable.");
 
     try {
@@ -1324,7 +1324,7 @@ _notmuch_message_sync (notmuch_message_t *message)
 {
     Xapian::WritableDatabase *db;
 
-    if (message->notmuch->mode == NOTMUCH_DATABASE_MODE_READ_ONLY)
+    if (_notmuch_database_mode (message->notmuch) == NOTMUCH_DATABASE_MODE_READ_ONLY)
        return;
 
     if (! message->modified)