move setting of ctx->listed outside the drivers
it's essentially an external state flag
This commit is contained in:
parent
7bab2d6d94
commit
c66afdc0a8
|
@ -1737,11 +1737,8 @@ imap_list( store_t *gctx,
|
||||||
void (*cb)( int sts, void *aux ), void *aux )
|
void (*cb)( int sts, void *aux ), void *aux )
|
||||||
{
|
{
|
||||||
imap_store_t *ctx = (imap_store_t *)gctx;
|
imap_store_t *ctx = (imap_store_t *)gctx;
|
||||||
int ret;
|
|
||||||
|
|
||||||
if ((ret = imap_exec_b( ctx, 0, "LIST \"\" \"%s%%\"", ctx->prefix )) == DRV_OK)
|
cb( imap_exec_b( ctx, 0, "LIST \"\" \"%s%%\"", ctx->prefix ), aux );
|
||||||
gctx->listed = 1;
|
|
||||||
cb( ret, aux );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -186,7 +186,6 @@ maildir_list( store_t *gctx,
|
||||||
!memcmp( buf, inbox, bl - 4 ) && !inbox[bl - 4] ? "INBOX" : de->d_name );
|
!memcmp( buf, inbox, bl - 4 ) && !inbox[bl - 4] ? "INBOX" : de->d_name );
|
||||||
}
|
}
|
||||||
closedir (dir);
|
closedir (dir);
|
||||||
gctx->listed = 1;
|
|
||||||
|
|
||||||
cb( DRV_OK, aux );
|
cb( DRV_OK, aux );
|
||||||
}
|
}
|
||||||
|
|
|
@ -705,6 +705,7 @@ store_listed( int sts, void *aux )
|
||||||
mvars->state[t] = ST_OPEN;
|
mvars->state[t] = ST_OPEN;
|
||||||
switch (sts) {
|
switch (sts) {
|
||||||
case DRV_OK:
|
case DRV_OK:
|
||||||
|
mvars->ctx[t]->listed = 1;
|
||||||
if (mvars->ctx[t]->conf->map_inbox)
|
if (mvars->ctx[t]->conf->map_inbox)
|
||||||
add_string_list( &mvars->ctx[t]->boxes, mvars->ctx[t]->conf->map_inbox );
|
add_string_list( &mvars->ctx[t]->boxes, mvars->ctx[t]->conf->map_inbox );
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user