static void update_index_unthreaded (CONTEXT *ctx, int check, int oldcount)
{
- int j;
+ int j, padding;
/* We are in a limited view. Check if the new message(s) satisfy
* the limit criteria. If they do, set their virtual msgno so that
* they will be visible in the limited view */
if (ctx->pattern)
{
+ padding = mx_msg_padding_size (ctx);
for (j = (check == MUTT_REOPENED) ? 0 : oldcount; j < ctx->msgcount; j++)
{
if (!j)
ctx->v2r[ctx->vcount] = j;
ctx->hdrs[j]->limited = 1;
ctx->vcount++;
- ctx->vsize += this_body->length + this_body->offset - this_body->hdr_offset;
+ ctx->vsize += this_body->length + this_body->offset -
+ this_body->hdr_offset + padding;
}
}
}
void mx_update_tables(CONTEXT *ctx, int committing)
{
- int i, j;
+ int i, j, padding;
/* update memory to reflect the new state of the mailbox */
ctx->vcount = 0;
ctx->unread = 0;
ctx->changed = 0;
ctx->flagged = 0;
+ padding = mx_msg_padding_size (ctx);
#define this_body ctx->hdrs[j]->content
for (i = 0, j = 0; i < ctx->msgcount; i++)
{
ctx->v2r[ctx->vcount] = j;
ctx->hdrs[j]->virtual = ctx->vcount++;
ctx->vsize += this_body->length + this_body->offset -
- this_body->hdr_offset;
+ this_body->hdr_offset + padding;
}
if (committing)
pattern_t *pat = NULL;
char buf[LONG_STRING] = "", *simple = NULL;
BUFFER err;
- int i, rv = -1;
+ int i, rv = -1, padding;
progress_t progress;
strfcpy (buf, NONULL (Context->pattern), sizeof (buf));
Context->vcount = 0;
Context->vsize = 0;
Context->collapsed = 0;
+ padding = mx_msg_padding_size (Context);
for (i = 0; i < Context->msgcount; i++)
{
Context->v2r[Context->vcount] = i;
Context->vcount++;
Context->vsize += this_body->length + this_body->offset -
- this_body->hdr_offset;
+ this_body->hdr_offset + padding;
}
}
}
#include "mutt.h"
#include "sort.h"
+#include "mailbox.h"
#include <string.h>
#include <ctype.h>
void mutt_set_virtual (CONTEXT *ctx)
{
- int i;
+ int i, padding;
HEADER *cur;
ctx->vcount = 0;
ctx->vsize = 0;
+ padding = mx_msg_padding_size (ctx);
for (i = 0; i < ctx->msgcount; i++)
{
cur->virtual = ctx->vcount;
ctx->v2r[ctx->vcount] = i;
ctx->vcount++;
- ctx->vsize += cur->content->length + cur->content->offset - cur->content->hdr_offset;
+ ctx->vsize += cur->content->length + cur->content->offset -
+ cur->content->hdr_offset + padding;
cur->num_hidden = mutt_get_hidden (ctx, cur);
}
}