Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing issue #3240 Seen/Unseen Flag not working correctly if sharedseen of a shared mailbox is not set to true #3577

Merged
merged 2 commits into from
Sep 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions imap/index.c
Original file line number Diff line number Diff line change
Expand Up @@ -4708,6 +4708,7 @@ static int index_storeflag(struct index_state *state,
int dirty = 0;
modseq_t oldmodseq;
struct index_map *im = &state->map[msgno-1];
struct index_record *record;
int r;

memset(modified_flags, 0, sizeof(struct index_modified_flags));
Expand Down Expand Up @@ -4740,6 +4741,9 @@ static int index_storeflag(struct index_state *state,
uint32_t internal_flags;
uint32_t user_flags[MAX_USER_FLAGS/32];

r = msgrecord_get_index_record_rw(msgrec, &record);
if (r) return r;

r = msgrecord_get_systemflags(msgrec, &system_flags);
if (r) return r;

Expand Down Expand Up @@ -4871,6 +4875,8 @@ static int index_storeflag(struct index_state *state,
if (r) return r;
r = msgrecord_set_userflags(msgrec, user_flags);
if (r) return r;
r = index_rewrite_record(state, msgno, record, /*silent*/0);
if (r) return r;

/* if it's silent and unchanged, update the seen value, but
* not if qresync is enabled - RFC 4551 says that the MODSEQ
Expand Down