From 96d99c383785dec67443ff1b45e2d2f8437398fa Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 11 Nov 2010 16:36:02 -0800 Subject: tags_to_maildir_flags: Fix to preserve existing, unsupported flags This is to prevent notmuch from destroying any information the user has encoded as flags in the maildir filename. Tests are also added to the test suite to verify the documented behavior. --- lib/notmuch.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/notmuch.h') diff --git a/lib/notmuch.h b/lib/notmuch.h index d2deca1..e508309 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -947,9 +947,11 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message); * * Specifically, for each filename corresponding to this message: * - * If the filename is not in a maildir directory, do nothing. - * (A maildir directory is determined as a directory named "new" or - * "cur".) + * If the filename is not in a maildir directory, do nothing. (A + * maildir directory is determined as a directory named "new" or + * "cur".) Similarly, if the filename has invalid maildir info, + * (repeated or outof-ASCII-order flag characters after ":2,"), then + * do nothing. * * If the filename is in a maildir directory, rename the file so that * its filename ends with the sequence ":2," followed by zero or more @@ -961,8 +963,8 @@ notmuch_message_maildir_flags_to_tags (notmuch_message_t *message); * 'R' iff the message has the "replied" tag * 'S' iff the message does not have the "unread" tag * - * Warning: any existing flags unmentioned in the list above will be - * removed by this renaming. + * Any existing flags unmentioned in the list above will be preserved + * in the renaming. * * Also, if this filename is in a directory named "new", rename it to * be within the neighboring directory named "cur". -- cgit v1.2.3