don't enter trash loop if not trashing at all. also, move expunge
message where it belongs. not adding info("trashing"), as it will be replaced in a moment anyway.
This commit is contained in:
parent
b5d70aa596
commit
c7903f8003
10
src/sync.c
10
src/sync.c
|
@ -1072,9 +1072,9 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan )
|
||||||
}
|
}
|
||||||
|
|
||||||
for (t = 0; t < 2; t++) {
|
for (t = 0; t < 2; t++) {
|
||||||
if (svars->chan->ops[t] & OP_EXPUNGE) {
|
if ((svars->chan->ops[t] & OP_EXPUNGE) &&
|
||||||
info( "Expunging %s\n", str_ms[t] );
|
(svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new))) {
|
||||||
debug( "expunging %s\n", str_ms[t] );
|
debug( "trashing in %s\n", str_ms[t] );
|
||||||
for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
|
for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
|
||||||
if (tmsg->flags & F_DELETED) {
|
if (tmsg->flags & F_DELETED) {
|
||||||
if (svars->ctx[t]->conf->trash) {
|
if (svars->ctx[t]->conf->trash) {
|
||||||
|
@ -1087,7 +1087,7 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan )
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
debug( " not trashing message %d - not new\n", tmsg->uid );
|
debug( " not trashing message %d - not new\n", tmsg->uid );
|
||||||
} else if (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new) {
|
} else {
|
||||||
if (!tmsg->srec || tmsg->srec->uid[1-t] < 0) {
|
if (!tmsg->srec || tmsg->srec->uid[1-t] < 0) {
|
||||||
if (!svars->ctx[1-t]->conf->max_size || tmsg->size <= svars->ctx[1-t]->conf->max_size) {
|
if (!svars->ctx[1-t]->conf->max_size || tmsg->size <= svars->ctx[1-t]->conf->max_size) {
|
||||||
debug( " remote trashing message %d\n", tmsg->uid );
|
debug( " remote trashing message %d\n", tmsg->uid );
|
||||||
|
@ -1104,6 +1104,8 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info( "Expunging %s...\n", str_ms[t] );
|
||||||
|
debug( "expunging %s\n", str_ms[t] );
|
||||||
switch (svars->drv[t]->close( svars->ctx[t] )) {
|
switch (svars->drv[t]->close( svars->ctx[t] )) {
|
||||||
case DRV_OK: svars->state[t] |= ST_DID_EXPUNGE; break;
|
case DRV_OK: svars->state[t] |= ST_DID_EXPUNGE; break;
|
||||||
case DRV_STORE_BAD: svars->ret = SYNC_BAD(t); goto finish;
|
case DRV_STORE_BAD: svars->ret = SYNC_BAD(t); goto finish;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user