aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-06-09 15:14:16 -0400
committerGravatar David Bremner <bremner@debian.org>2012-06-10 20:13:58 -0300
commit750231bae8a0bdb3273c2f9a74da14327fbc5d52 (patch)
treec6dd157981af64afa312eae8b1dbbd6c15fbf713 /lib
parent93ab4c7d119bb751c4d7297cb18a6f5eb50ae478 (diff)
lib: Only synchronize maildir flags for messages in maildirs
Previously, we synchronized flags to tags for any message that looked like it had maildir flags in its file name, regardless of whether it was in a maildir-like directory structure. This was asymmetric with tag-to-flag synchronization, which only applied to messages in directories named new/ and cur/ (introduced by 95dd5fe5). This change makes our interpretation stricter and addresses this asymmetry by only synchronizing flags to tags for messages in directories named new/ or cur/. It also prepares us to treat messages in new/ as maildir messages, even though they lack maildir flags.
Diffstat (limited to 'lib')
-rw-r--r--lib/message.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/message.cc b/lib/message.cc
index ed96477f..bbac2ffa 100644
--- a/lib/message.cc
+++ b/lib/message.cc
@@ -1074,7 +1074,7 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)
const char *flags;
notmuch_status_t status;
notmuch_filenames_t *filenames;
- const char *filename;
+ const char *filename, *dir;
char *combined_flags = talloc_strdup (message, "");
unsigned i;
int seen_maildir_info = 0;
@@ -1084,6 +1084,10 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message)
notmuch_filenames_move_to_next (filenames))
{
filename = notmuch_filenames_get (filenames);
+ dir = _filename_is_in_maildir (filename);
+
+ if (! dir)
+ continue;
flags = strstr (filename, ":2,");
if (! flags)