diff options
author | Austin Clements <amdragon@MIT.EDU> | 2012-06-09 15:14:17 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-06-10 20:14:56 -0300 |
commit | b88030bda6da084ef74e41f588589fd98e773ad7 (patch) | |
tree | 07a74d6cf572df09d63f24f50c87d804eeb3c1a3 /lib | |
parent | 750231bae8a0bdb3273c2f9a74da14327fbc5d52 (diff) |
lib: Treat messages in new/ as maildir messages with no flags set
Previously, notmuch new only synchronized maildir flags to tags for
files with a maildir "info" part. Since messages in new/ don't have
an info part, notmuch would ignore them for flag-to-tag
synchronization.
This patch makes notmuch consider messages in new/ to be legitimate
maildir messages that simply have no maildir flags set. The most
visible effect of this is that such messages now automatically get the
unread tag.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/message.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/message.cc b/lib/message.cc index bbac2ffa..978de066 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -1090,13 +1090,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 |