X-Git-Url: https://rtime.felk.cvut.cz/gitweb/notmuch.git/blobdiff_plain/f0dfda5c7797f9db81ce35d270fe0ac406c7fca1..4135a1f8dae02e712ff172ae38f68b74f9721236:/lib/thread.cc diff --git a/lib/thread.cc b/lib/thread.cc index bc078778..79c3e9bb 100644 --- a/lib/thread.cc +++ b/lib/thread.cc @@ -238,20 +238,22 @@ _thread_add_message (notmuch_thread_t *thread, char *clean_author; notmuch_bool_t message_excluded = FALSE; - for (tags = notmuch_message_get_tags (message); - notmuch_tags_valid (tags); - notmuch_tags_move_to_next (tags)) - { - tag = notmuch_tags_get (tags); - /* Is message excluded? */ - for (notmuch_string_node_t *term = exclude_terms->head; - term != NULL; - term = term->next) + if (omit_exclude != NOTMUCH_EXCLUDE_FALSE) { + for (tags = notmuch_message_get_tags (message); + notmuch_tags_valid (tags); + notmuch_tags_move_to_next (tags)) { - /* We ignore initial 'K'. */ - if (strcmp(tag, (term->string + 1)) == 0) { - message_excluded = TRUE; - break; + tag = notmuch_tags_get (tags); + /* Is message excluded? */ + for (notmuch_string_node_t *term = exclude_terms->head; + term != NULL; + term = term->next) + { + /* We ignore initial 'K'. */ + if (strcmp(tag, (term->string + 1)) == 0) { + message_excluded = TRUE; + break; + } } } } @@ -275,14 +277,15 @@ _thread_add_message (notmuch_thread_t *thread, address = internet_address_list_get_address (list, 0); if (address) { author = internet_address_get_name (address); - if (author == NULL) { + /* We treat quoted empty names as if they were empty. */ + if (author == NULL || author[0] == '\0') { InternetAddressMailbox *mailbox; mailbox = INTERNET_ADDRESS_MAILBOX (address); author = internet_address_mailbox_get_addr (mailbox); } clean_author = _thread_cleanup_author (thread, author, from); _thread_add_author (thread, clean_author); - notmuch_message_set_author (message, clean_author); + _notmuch_message_set_author (message, clean_author); } g_object_unref (G_OBJECT (list)); } @@ -371,7 +374,7 @@ _thread_add_matched_message (notmuch_thread_t *thread, NOTMUCH_MESSAGE_FLAG_MATCH, 1); } - _thread_add_matched_author (thread, notmuch_message_get_author (hashed_message)); + _thread_add_matched_author (thread, _notmuch_message_get_author (hashed_message)); } static void @@ -522,7 +525,7 @@ _notmuch_thread_create (void *ctx, _resolve_thread_relationships (thread); /* Commit to returning thread. */ - talloc_steal (ctx, thread); + (void) talloc_steal (ctx, thread); DONE: talloc_free (local);