]> git.notmuchmail.org Git - notmuch/blobdiff - lib/index.cc
lib: enforce that n_message_reindex takes headers from first file
[notmuch] / lib / index.cc
index 0c4e232924ce1e139066c02c9f03bb5336f4167d..2b98b588d38d4532173a503cc652aa5e8d3c3de1 100644 (file)
@@ -261,7 +261,7 @@ notmuch_filter_discard_non_term_new (GMimeContentType *content_type)
        type = g_type_register_static (GMIME_TYPE_FILTER, "NotmuchFilterDiscardNonTerm", &info, (GTypeFlags) 0);
     }
 
-    filter = (NotmuchFilterDiscardNonTerm *) g_object_newv (type, 0, NULL);
+    filter = (NotmuchFilterDiscardNonTerm *) g_object_new (type, NULL);
     filter->content_type = content_type;
     filter->state = 0;
     if (g_mime_content_type_is_type (content_type, "text", "html")) {
@@ -490,7 +490,7 @@ _notmuch_message_index_file (notmuch_message_t *message,
 {
     GMimeMessage *mime_message;
     InternetAddressList *addresses;
-    const char *from, *subject;
+    const char *subject;
     notmuch_status_t status;
 
     status = _notmuch_message_file_get_mime_message (message_file,
@@ -498,12 +498,10 @@ _notmuch_message_index_file (notmuch_message_t *message,
     if (status)
        return status;
 
-    from = g_mime_message_get_sender (mime_message);
-
-    addresses = internet_address_list_parse_string (from);
+    addresses = g_mime_message_get_from (mime_message);
     if (addresses) {
        _index_address_list (message, "from", addresses);
-       g_object_unref (addresses);
+       g_mime_2_6_unref (addresses);
     }
 
     addresses = g_mime_message_get_all_recipients (mime_message);