|
|
@ -799,7 +799,9 @@ box_opened2( sync_vars_t *svars, int t ) |
|
|
|
svars->any_expiring = 1; |
|
|
|
svars->any_expiring = 1; |
|
|
|
if (svars->any_expiring) { |
|
|
|
if (svars->any_expiring) { |
|
|
|
opts[N] |= OPEN_OLD | OPEN_FLAGS; |
|
|
|
opts[N] |= OPEN_OLD | OPEN_FLAGS; |
|
|
|
if (chan->ops[N] & (OP_NEW | OP_RENEW)) |
|
|
|
if (any_dummies[N]) |
|
|
|
|
|
|
|
opts[F] |= OPEN_OLD | OPEN_FLAGS; |
|
|
|
|
|
|
|
else if (chan->ops[N] & (OP_NEW | OP_RENEW)) |
|
|
|
opts[F] |= OPEN_FLAGS; |
|
|
|
opts[F] |= OPEN_FLAGS; |
|
|
|
} |
|
|
|
} |
|
|
|
svars->opts[F] = svars->drv[F]->prepare_load_box( ctx[F], opts[F] ); |
|
|
|
svars->opts[F] = svars->drv[F]->prepare_load_box( ctx[F], opts[F] ); |
|
|
@ -1284,10 +1286,30 @@ box_loaded( int sts, message_t *msgs, int total_msgs, int recent_msgs, void *aux |
|
|
|
// to expire in the first place.
|
|
|
|
// to expire in the first place.
|
|
|
|
if (!srec->msg[N]) |
|
|
|
if (!srec->msg[N]) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
nflags = (srec->msg[N]->flags | srec->aflags[N]) & ~srec->dflags[N]; |
|
|
|
nflags = srec->msg[N]->flags; |
|
|
|
|
|
|
|
if (srec->status & S_DUMMY(N)) { |
|
|
|
|
|
|
|
if (!srec->msg[F]) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
// We need to pull in the real Flagged and Seen even if flag
|
|
|
|
|
|
|
|
// propagation was not requested, as the placeholder's ones are
|
|
|
|
|
|
|
|
// useless (except for un-seeing).
|
|
|
|
|
|
|
|
// This results in the somewhat weird situation that messages
|
|
|
|
|
|
|
|
// which are not visibly flagged remain unexpired.
|
|
|
|
|
|
|
|
sflags = srec->msg[F]->flags; |
|
|
|
|
|
|
|
aflags = (sflags & ~srec->flags) & (F_SEEN | F_FLAGGED); |
|
|
|
|
|
|
|
dflags = (~sflags & srec->flags) & F_SEEN; |
|
|
|
|
|
|
|
nflags = (nflags & (~(F_SEEN | F_FLAGGED) | (srec->flags & F_SEEN)) & ~dflags) | aflags; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
nflags = (nflags | srec->aflags[N]) & ~srec->dflags[N]; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
if (srec->status & S_UPGRADE) { |
|
|
|
|
|
|
|
// The dummy's F & S flags are mostly masked out anyway,
|
|
|
|
|
|
|
|
// but we may be pulling in the real ones.
|
|
|
|
|
|
|
|
nflags = (srec->pflags | srec->aflags[N]) & ~srec->dflags[N]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
nflags = srec->msg[F]->flags; |
|
|
|
nflags = srec->msg[F]->flags; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (!(nflags & F_DELETED) || (srec->status & (S_EXPIRE | S_EXPIRED))) { |
|
|
|
if (!(nflags & F_DELETED) || (srec->status & (S_EXPIRE | S_EXPIRED))) { |
|
|
|
// The message is not deleted, or it is, but only due to being expired.
|
|
|
|
// The message is not deleted, or it is, but only due to being expired.
|
|
|
|
arecs[alive++] = (alive_srec_t){ srec, nflags }; |
|
|
|
arecs[alive++] = (alive_srec_t){ srec, nflags }; |
|
|
|