]> git.notmuchmail.org Git - notmuch/commitdiff
Add support for message-part mime parts.
authorCarl Worth <cworth@cworth.org>
Thu, 15 Oct 2009 00:25:20 +0000 (17:25 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 15 Oct 2009 00:25:20 +0000 (17:25 -0700)
We could (and probably should) reparse and index all the headers from
the embedded message, but I'm not choosing to do that now---I'm just
indexing the body of the embedded message.

notmuch-index-message.cc

index 5c73825ba2f48e3d7964994d497e104c1a6464a0..a3483b93b6b35b01c1bb95caa8beba2b55d70526 100644 (file)
@@ -475,7 +475,17 @@ gen_terms_part (Xapian::TermGenerator term_gen,
        return;
     }
 
-    if (! GMIME_IS_PART (part)) {
+    if (GMIME_IS_MESSAGE_PART (part)) {
+       GMimeMessage *message;
+
+       message = g_mime_message_part_get_message (GMIME_MESSAGE_PART (part));
+
+       gen_terms_part (term_gen, g_mime_message_get_mime_part (message));
+
+       return;
+    }
+
+    if (! (GMIME_IS_PART (part))) {
        fprintf (stderr, "Warning: Not indexing unknown mime part: %s.\n",
                 g_type_name (G_OBJECT_TYPE (part)));
        return;