{
h = idata->ctx->hdrs[cur];
- if (HEADER_DATA (h)->sid == expno)
- HEADER_DATA (h)->sid = 0;
- else if (HEADER_DATA (h)->sid > expno)
- HEADER_DATA (h)->sid--;
+ if (h->index+1 == expno)
+ h->index = -1;
+ else if (h->index+1 > expno)
+ h->index--;
}
idata->reopen |= IMAP_EXPUNGE_PENDING;
{
h = idata->ctx->hdrs[i];
- if (!HEADER_DATA(h)->sid)
+ if (h->index == -1)
{
dprint (2, (debugfile, "Expunging message UID %d.\n", HEADER_DATA (h)->uid));
/* update context with message header */
ctx->hdrs[msgno] = mutt_new_header ();
- ctx->hdrs[msgno]->index = ctx->msgcount;
+ ctx->hdrs[msgno]->index = ctx->msgcount;
+ ctx->hdrs[msgno]->index = h.sid - 1;
+ if (h.sid != ctx->msgcount + 1)
+ dprint (1, (debugfile, "imap_read_headers: msgcount and sequence ID are inconsistent!"));
/* messages which have not been expunged are ACTIVE (borrowed from mh
* folders) */
ctx->hdrs[msgno]->active = 1;
/* skip to message number */
buf = imap_next_word (buf);
- h->data->sid = atoi (buf);
+ h->sid = atoi (buf);
/* find FETCH tag */
buf = imap_next_word (buf);
/* IMAP-specific header data, stored as HEADER->data */
typedef struct imap_header_data
{
- unsigned int sid; /* server message sequence number */
unsigned int uid; /* 32-bit Message UID */
LIST *keywords;
} IMAP_HEADER_DATA;
unsigned int replied : 1;
unsigned int changed : 1;
+ unsigned int sid;
+
IMAP_HEADER_DATA* data;
time_t received;