Browse Source

use UID EXPUNGE also when trashing remotely

amends 2f0fbcd3.
wip/maildir-path-under-inbox
Oswald Buddenhagen 3 years ago
parent
commit
edbf9a35da
  1. 3
      src/driver.h
  2. 4
      src/drv_imap.c
  3. 2
      src/drv_maildir.c
  4. 4
      src/sync.c

3
src/driver.h

@ -97,6 +97,9 @@ BIT_ENUM(
OPEN_APPEND, OPEN_APPEND,
OPEN_SETFLAGS, OPEN_SETFLAGS,
OPEN_EXPUNGE, OPEN_EXPUNGE,
// Expunge only deleted messages we know about. Relies on OPEN_{OLD,NEW,FLAGS}
// being set externally. The driver may unset it if it can't handle it.
OPEN_UID_EXPUNGE,
) )
#define UIDVAL_BAD ((uint)-1) #define UIDVAL_BAD ((uint)-1)

4
src/drv_imap.c

@ -2812,6 +2812,8 @@ imap_prepare_load_box( store_t *gctx, uint opts )
{ {
imap_store_t *ctx = (imap_store_t *)gctx; imap_store_t *ctx = (imap_store_t *)gctx;
if (!CAP(UIDPLUS))
opts &= ~OPEN_UID_EXPUNGE;
ctx->opts = opts; ctx->opts = opts;
return opts; return opts;
} }
@ -3129,7 +3131,7 @@ imap_close_box( store_t *gctx,
assert( !ctx->num_wait_check ); assert( !ctx->num_wait_check );
if (ctx->conf->trash && CAP(UIDPLUS)) { if (ctx->opts & OPEN_UID_EXPUNGE) {
INIT_REFCOUNTED_STATE(imap_expunge_state_t, sts, cb, aux) INIT_REFCOUNTED_STATE(imap_expunge_state_t, sts, cb, aux)
imap_message_t *msg, *fmsg, *nmsg; imap_message_t *msg, *fmsg, *nmsg;
int bl; int bl;

2
src/drv_maildir.c

@ -1406,7 +1406,7 @@ maildir_prepare_load_box( store_t *gctx, uint opts )
if (opts & OPEN_SETFLAGS) if (opts & OPEN_SETFLAGS)
opts |= OPEN_PAIRED; opts |= OPEN_PAIRED;
if (opts & OPEN_EXPUNGE) if (opts & OPEN_EXPUNGE)
opts |= OPEN_PAIRED | OPEN_OLD | OPEN_NEW | OPEN_FLAGS; opts |= OPEN_PAIRED | OPEN_OLD | OPEN_NEW | OPEN_FLAGS | OPEN_UID_EXPUNGE;
ctx->opts = opts; ctx->opts = opts;
return opts; return opts;
} }

4
src/sync.c

@ -793,9 +793,9 @@ box_opened2( sync_vars_t *svars, int t )
if (chan->stores[t]->trash) { if (chan->stores[t]->trash) {
if (!chan->stores[t]->trash_only_new) if (!chan->stores[t]->trash_only_new)
opts[t] |= OPEN_OLD; opts[t] |= OPEN_OLD;
opts[t] |= OPEN_NEW|OPEN_FLAGS; opts[t] |= OPEN_NEW | OPEN_FLAGS | OPEN_UID_EXPUNGE;
} else if (chan->stores[t^1]->trash && chan->stores[t^1]->trash_remote_new) { } else if (chan->stores[t^1]->trash && chan->stores[t^1]->trash_remote_new) {
opts[t] |= OPEN_NEW|OPEN_FLAGS; opts[t] |= OPEN_NEW | OPEN_FLAGS | OPEN_UID_EXPUNGE;
} }
} }
} }

Loading…
Cancel
Save