]> git.notmuchmail.org Git - notmuch/blobdiff - lib/index.cc
lib: content disposition values are not case-sensitive
[notmuch] / lib / index.cc
index c88ed8d744334ba2f1e7acaf02e9c812ff14ed91..f166aefd2fc1f6f6c5ea1e306e4fc033ead09c59 100644 (file)
@@ -314,7 +314,8 @@ _index_mime_part (notmuch_message_t *message,
     const char *charset;
 
     if (! part) {
-       fprintf (stderr, "Warning: Not indexing empty mime part.\n");
+       _notmuch_database_log (_notmuch_message_database (message),
+                             "Warning: Not indexing empty mime part.\n");
        return;
     }
 
@@ -344,7 +345,8 @@ _index_mime_part (notmuch_message_t *message,
                if (i == 1)
                    continue;
                if (i > 1)
-                   fprintf (stderr, "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");
+                   _notmuch_database_log (_notmuch_message_database (message),
+                                         "Warning: Unexpected extra parts of multipart/signed. Indexing anyway.\n");
            }
            if (GMIME_IS_MULTIPART_ENCRYPTED (multipart)) {
                /* Don't index encrypted parts. */
@@ -367,14 +369,16 @@ _index_mime_part (notmuch_message_t *message,
     }
 
     if (! (GMIME_IS_PART (part))) {
-       fprintf (stderr, "Warning: Not indexing unknown mime part: %s.\n",
-                g_type_name (G_OBJECT_TYPE (part)));
+       _notmuch_database_log (_notmuch_message_database (message),
+                             "Warning: Not indexing unknown mime part: %s.\n",
+                             g_type_name (G_OBJECT_TYPE (part)));
        return;
     }
 
     disposition = g_mime_object_get_content_disposition (part);
     if (disposition &&
-       strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
+       strcasecmp (g_mime_content_disposition_get_disposition (disposition),
+                   GMIME_DISPOSITION_ATTACHMENT) == 0)
     {
        const char *filename = g_mime_part_get_filename (GMIME_PART (part));