X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fmessage.cc;h=8720c1b542d839a24613991b4b425fe03f65e1e3;hp=bbac2ffaf87da987b1c7f05244ce1caf801831c1;hb=f55b35b3df4d8708dfba0e95e33877305fd9f8d9;hpb=750231bae8a0bdb3273c2f9a74da14327fbc5d52 diff --git a/lib/message.cc b/lib/message.cc index bbac2ffa..8720c1b5 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -462,9 +462,9 @@ notmuch_message_get_thread_id (notmuch_message_t *message) void _notmuch_message_add_reply (notmuch_message_t *message, - notmuch_message_node_t *reply) + notmuch_message_t *reply) { - _notmuch_message_list_append (message->replies, reply); + _notmuch_message_list_add_message (message->replies, reply); } notmuch_messages_t * @@ -788,7 +788,9 @@ notmuch_message_get_tags (notmuch_message_t *message) * possible to modify the message tags (which talloc_unlink's the * current list from the message) while still iterating because * the iterator will keep the current list alive. */ - talloc_reference (message, message->tag_list); + if (!talloc_reference (message, message->tag_list)) + return NULL; + return tags; } @@ -1090,13 +1092,19 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message) continue; flags = strstr (filename, ":2,"); - if (! flags) - continue; - - seen_maildir_info = 1; - flags += 3; - - combined_flags = talloc_strdup_append (combined_flags, flags); + if (flags) { + seen_maildir_info = 1; + flags += 3; + combined_flags = talloc_strdup_append (combined_flags, flags); + } else if (STRNCMP_LITERAL (dir, "new/") == 0) { + /* Messages are delivered to new/ with no "info" part, but + * they effectively have default maildir flags. According + * to the spec, we should ignore the info part for + * messages in new/, but some MUAs (mutt) can set maildir + * flags on messages in new/, so we're liberal in what we + * accept. */ + seen_maildir_info = 1; + } } /* If none of the filenames have any maildir info field (not even