diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-08 06:05:51 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-09-08 06:05:51 +0000 |
commit | f24c25bff3454897fbb8a6a888d1311e867f800e (patch) | |
tree | ba7cd964ac22925d28b350b26dd2712ec3be87a3 /mx.c | |
parent | 491856cbb79b2f643facf291c1918bfb919966bd (diff) |
The attached patch:
* gets Mutt to properly log off the IMAP server when quitting. Clients
don't care, but it's polite and proper.
* further updates the flags changes from yesterday
* uses CLOSE instead of EXPUNGE when closing a mailbox and purging
messages, for some slight speed gain.
* purges all messages marked for deletion in one command (if purging),
making for very cool speed gains switching mailboxes if you're on,
say, a few high volume mailing lists. Yeah, baby! (I personally love
this one).
(From Brendan Cully <brendan@kublai.com>)
Diffstat (limited to 'mx.c')
-rw-r--r-- | mx.c | 50 |
1 files changed, 25 insertions, 25 deletions
@@ -868,37 +868,37 @@ int mx_close_mailbox (CONTEXT *ctx) { if (imap_sync_mailbox (ctx, purge) == -1) return -1; + if (ctx->magic == M_IMAP && !purge) + mutt_message (_("%d kept."), ctx->msgcount); } + else #endif - if (!purge) { - for (i = 0; i < ctx->msgcount; i++) - ctx->hdrs[i]->deleted = 0; - ctx->deleted = 0; - } + if (!purge) + { + for (i = 0; i < ctx->msgcount; i++) + ctx->hdrs[i]->deleted = 0; + ctx->deleted = 0; + } - if (ctx->changed || ctx->deleted) - { - if (sync_mailbox (ctx) == -1) - return (-1); - } + if (ctx->changed || ctx->deleted) + { + if (sync_mailbox (ctx) == -1) + return -1; + } -#ifdef USE_IMAP - if (ctx->magic == M_IMAP && !purge) - mutt_message (_("%d kept."), ctx->msgcount); - else -#endif - if (move_messages) - mutt_message (_("%d kept, %d moved, %d deleted."), - ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted); - else - mutt_message (_("%d kept, %d deleted."), - ctx->msgcount - ctx->deleted, ctx->deleted); + if (move_messages) + mutt_message (_("%d kept, %d moved, %d deleted."), + ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted); + else + mutt_message (_("%d kept, %d deleted."), + ctx->msgcount - ctx->deleted, ctx->deleted); - if (ctx->msgcount == ctx->deleted && - (ctx->magic == M_MMDF || ctx->magic == M_MBOX) && - !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY)) - mx_unlink_empty (ctx->path); + if (ctx->msgcount == ctx->deleted && + (ctx->magic == M_MMDF || ctx->magic == M_MBOX) && + !mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY)) + mx_unlink_empty (ctx->path); + } mx_fastclose_mailbox (ctx); |