]> git.notmuchmail.org Git - notmuch/blobdiff - lib/index.cc
Fix to index the "Re" term present in any subject.
[notmuch] / lib / index.cc
index cf930251c8c7be4c34bb53dab6930cca940d0302..bdfb8ed5c363aea8a2c44e3a8d9ce902185118ab 100644 (file)
@@ -63,7 +63,7 @@ struct _NotmuchFilterDiscardUuencodeClass {
     GMimeFilterClass parent_class;
 };
 
-GMimeFilter *notmuch_filter_discard_uuencode_new (void);
+static GMimeFilter *notmuch_filter_discard_uuencode_new (void);
 
 static void notmuch_filter_discard_uuencode_finalize (GObject *object);
 
@@ -195,7 +195,7 @@ filter_reset (GMimeFilter *gmime_filter)
  *
  * Returns: a new #NotmuchFilterDiscardUuencode filter.
  **/
-GMimeFilter *
+static GMimeFilter *
 notmuch_filter_discard_uuencode_new (void)
 {
     static GType type = 0;
@@ -304,26 +304,6 @@ _index_address_list (notmuch_message_t *message,
     }
 }
 
-static const char *
-skip_re_in_subject (const char *subject)
-{
-    const char *s = subject;
-
-    if (subject == NULL)
-       return NULL;
-
-    while (*s) {
-       while (*s && isspace (*s))
-           s++;
-       if (strncasecmp (s, "re:", 3) == 0)
-           s += 3;
-       else
-           break;
-    }
-
-    return s;
-}
-
 /* Callback to generate terms for each mime part of a message. */
 static void
 _index_mime_part (notmuch_message_t *message,
@@ -336,6 +316,11 @@ _index_mime_part (notmuch_message_t *message,
     GMimeContentDisposition *disposition;
     char *body;
 
+    if (! part) {
+       fprintf (stderr, "Warning: Not indexing empty mime part.\n");
+       return;
+    }
+
     if (GMIME_IS_MULTIPART (part)) {
        GMimeMultipart *multipart = GMIME_MULTIPART (part);
        int i;
@@ -454,7 +439,6 @@ _notmuch_message_index_file (notmuch_message_t *message,
     _index_address_list (message, "to", addresses);
 
     subject = g_mime_message_get_subject (mime_message);
-    subject = skip_re_in_subject (subject);
     _notmuch_message_gen_terms (message, "subject", subject);
 
     _index_mime_part (message, g_mime_message_get_mime_part (mime_message));