Skip to content

Commit

Permalink
index: tell UID and MODSEQ during a fetch setseen if they would be gi…
Browse files Browse the repository at this point in the history
…ven in tellflags

This makes the CONDSTORE/QRESYNC magic line up
  • Loading branch information
brong committed Jul 2, 2015
1 parent 670199e commit de4ddb9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions imap/index.c
Expand Up @@ -3847,9 +3847,10 @@ static int index_fetchreply(struct index_state *state, uint32_t msgno,
return 0;
}
}
int ischanged = im->told_modseq < record.modseq;

/* display flags if asked _OR_ if they've changed */
if (fetchitems & FETCH_FLAGS || im->told_modseq < record.modseq) {
if (fetchitems & FETCH_FLAGS || ischanged) {
index_fetchflags(state, msgno);
sepchar = ' ';
}
Expand All @@ -3859,7 +3860,7 @@ static int index_fetchreply(struct index_state *state, uint32_t msgno,
prot_printf(state->out, "* %u FETCH ", msgno);
started = 1;
}
if (fetchitems & FETCH_UID) {
if (fetchitems & FETCH_UID || (ischanged && (client_capa & CAPA_QRESYNC))) {
prot_printf(state->out, "%cUID %u", sepchar, record.uid);
sepchar = ' ';
}
Expand All @@ -3879,7 +3880,7 @@ static int index_fetchreply(struct index_state *state, uint32_t msgno,
sepchar, datebuf);
sepchar = ' ';
}
if (fetchitems & FETCH_MODSEQ) {
if (fetchitems & FETCH_MODSEQ || (ischanged && (client_capa & CAPA_CONDSTORE))) {
prot_printf(state->out, "%cMODSEQ (" MODSEQ_FMT ")",
sepchar, record.modseq);
sepchar = ' ';
Expand Down

0 comments on commit de4ddb9

Please sign in to comment.