]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message.cc
lib: Split the database upgrade into two phases for safer operation.
[notmuch] / lib / message.cc
index baeaa46972867d10a1cc5cde801fac03c0817df1..1cda55a1e1b67b9573f7994018cc97bb73d08acc 100644 (file)
@@ -416,22 +416,16 @@ _notmuch_message_add_filename (notmuch_message_t *message,
     return NOTMUCH_STATUS_SUCCESS;
 }
 
-/* Move the filename from the data field (as it was in database format
- * version 0) to a file-direntry term instead (as in database format
- * version 1).
- */
-void
-_notmuch_message_upgrade_filename_storage (notmuch_message_t *message)
+char *
+_notmuch_message_talloc_copy_data (notmuch_message_t *message)
 {
-    char *filename;
+    return talloc_strdup (message, message->doc.get_data ().c_str ());
+}
 
-    filename = talloc_strdup (message, message->doc.get_data ().c_str ());
-    if (filename && *filename != '\0') {
-       _notmuch_message_add_filename (message, filename);
-       message->doc.set_data ("");
-       _notmuch_message_sync (message);
-    }
-    talloc_free (filename);
+void
+_notmuch_message_clear_data (notmuch_message_t *message)
+{
+    message->doc.set_data ("");
 }
 
 const char *