commit 16eaf903db6090c9bc2f5b54b2388fe477b07908
parent c7903f800314c7c90566b9554c79e1e1734c04bb
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Tue, 21 Mar 2006 17:40:31 +0000
ok, mismerging and not running the reg-tests is lame. unscrew expunging
again.
Diffstat:
M | src/sync.c | | | 57 | +++++++++++++++++++++++++++++---------------------------- |
1 file changed, 29 insertions(+), 28 deletions(-)
diff --git a/src/sync.c b/src/sync.c
@@ -1072,37 +1072,38 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan )
}
for (t = 0; t < 2; t++) {
- if ((svars->chan->ops[t] & OP_EXPUNGE) &&
- (svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new))) {
- debug( "trashing in %s\n", str_ms[t] );
- for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
- if (tmsg->flags & F_DELETED) {
- if (svars->ctx[t]->conf->trash) {
- if (!svars->ctx[t]->conf->trash_only_new || !tmsg->srec || tmsg->srec->uid[1-t] < 0) {
- debug( " trashing message %d\n", tmsg->uid );
- switch (svars->drv[t]->trash_msg( svars->ctx[t], tmsg )) {
- case DRV_OK: break;
- case DRV_STORE_BAD: svars->ret = SYNC_BAD(t); goto finish;
- default: svars->ret = SYNC_FAIL; goto nexex;
- }
- } else
- debug( " not trashing message %d - not new\n", tmsg->uid );
- } else {
- 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) {
- debug( " remote trashing message %d\n", tmsg->uid );
- switch ((svars->ret = copy_msg( svars->ctx, 1 - t, tmsg, 0, 0 ))) {
- case SYNC_OK: break;
- case SYNC_NOGOOD: svars->ret = SYNC_FAIL; goto nexex;
- case SYNC_FAIL: goto nexex;
- default: goto finish;
+ if (svars->chan->ops[t] & OP_EXPUNGE) {
+ if (svars->ctx[t]->conf->trash || (svars->ctx[1-t]->conf->trash && svars->ctx[1-t]->conf->trash_remote_new)) {
+ debug( "trashing in %s\n", str_ms[t] );
+ for (tmsg = svars->ctx[t]->msgs; tmsg; tmsg = tmsg->next)
+ if (tmsg->flags & F_DELETED) {
+ if (svars->ctx[t]->conf->trash) {
+ if (!svars->ctx[t]->conf->trash_only_new || !tmsg->srec || tmsg->srec->uid[1-t] < 0) {
+ debug( " trashing message %d\n", tmsg->uid );
+ switch (svars->drv[t]->trash_msg( svars->ctx[t], tmsg )) {
+ case DRV_OK: break;
+ case DRV_STORE_BAD: svars->ret = SYNC_BAD(t); goto finish;
+ default: svars->ret = SYNC_FAIL; goto nexex;
}
} else
- debug( " not remote trashing message %d - too big\n", tmsg->uid );
- } else
- debug( " not remote trashing message %d - not new\n", tmsg->uid );
+ debug( " not trashing message %d - not new\n", tmsg->uid );
+ } else {
+ 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) {
+ debug( " remote trashing message %d\n", tmsg->uid );
+ switch ((svars->ret = copy_msg( svars->ctx, 1 - t, tmsg, 0, 0 ))) {
+ case SYNC_OK: break;
+ case SYNC_NOGOOD: svars->ret = SYNC_FAIL; goto nexex;
+ case SYNC_FAIL: goto nexex;
+ default: goto finish;
+ }
+ } else
+ debug( " not remote trashing message %d - too big\n", tmsg->uid );
+ } else
+ debug( " not remote trashing message %d - not new\n", tmsg->uid );
+ }
}
- }
+ }
info( "Expunging %s...\n", str_ms[t] );
debug( "expunging %s\n", str_ms[t] );