X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=e011788da590a74433a526c5fe727e604be7db3e;hp=a4829327ddddc2e79e35d6b22faff2ec4351dea2;hb=0082a55785a5ae64da22fe72af6c0ae928f13c03;hpb=b10ce6bc23002d48916b1b2f375480e7540e3164 diff --git a/notmuch-new.c b/notmuch-new.c index a4829327..e011788d 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -267,10 +267,16 @@ add_file (notmuch_database_t *notmuch, const char *filename, case NOTMUCH_STATUS_SUCCESS: state->added_messages++; notmuch_message_freeze (message); - for (tag = state->new_tags; *tag != NULL; tag++) - notmuch_message_add_tag (message, *tag); if (state->synchronize_flags) notmuch_message_maildir_flags_to_tags (message); + + for (tag = state->new_tags; *tag != NULL; tag++) { + if (strcmp ("unread", *tag) !=0 || + !notmuch_message_has_maildir_flag (message, 'S')) { + notmuch_message_add_tag (message, *tag); + } + } + notmuch_message_thaw (message); break; /* Non-fatal issues (go on to next file). */