Skip to content

Commit

Permalink
Merge pull request #3577 from tpayen/patch-1
Browse files Browse the repository at this point in the history
Fixing issue #3240 Seen/Unseen Flag not working correctly if sharedseen of a shared mailbox is not set to true
  • Loading branch information
brong committed Sep 21, 2022
2 parents 89617bb + 7b9ceaf commit 4b2c95e
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 4b2c95e

Please sign in to comment.