]> git.notmuchmail.org Git - notmuch/blobdiff - lib/message.cc
lib: wrap use of g_mime_utils_header_decode_date
[notmuch] / lib / message.cc
index e08659e5d96a15b7564e280cc0716b3d83985516..f78e5a9d302fd62c09e41dfc59966b57e3056c3b 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <gmime/gmime.h>
 
-struct visible _notmuch_message {
+struct _notmuch_message {
     notmuch_database_t *notmuch;
     Xapian::docid doc_id;
     int frozen;
@@ -870,9 +870,9 @@ _notmuch_message_ensure_filename_list (notmuch_message_t *message)
         *
         * It would be nice to do the upgrade of the document directly
         * here, but the database is likely open in read-only mode. */
-       const char *data;
 
-       data = message->doc.get_data ().c_str ();
+       std::string datastr = message->doc.get_data ();
+       const char *data = datastr.c_str ();
 
        if (data == NULL)
            INTERNAL_ERROR ("message with no filename");
@@ -1037,7 +1037,7 @@ _notmuch_message_set_header_values (notmuch_message_t *message,
     if (date == NULL || *date == '\0') {
        time_value = 0;
     } else {
-       time_value = g_mime_utils_header_decode_date (date, NULL);
+       time_value = g_mime_utils_header_decode_date_unix (date);
        /*
         * Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=779923
         */
@@ -1129,7 +1129,7 @@ _notmuch_message_delete (notmuch_message_t *message)
     query = notmuch_query_create (notmuch, query_string);
     if (query == NULL)
        return NOTMUCH_STATUS_OUT_OF_MEMORY;
-    status = notmuch_query_count_messages_st (query, &count);
+    status = notmuch_query_count_messages (query, &count);
     if (status) {
        notmuch_query_destroy (query);
        return status;
@@ -1843,7 +1843,7 @@ _notmuch_message_ensure_property_map (notmuch_message_t *message)
        const char *key;
        char *value;
 
-       value = index(node->string, '=');
+       value = strchr(node->string, '=');
        if (!value)
            INTERNAL_ERROR ("malformed property term");