#include "keymap.h"
#include "url.h"
+#ifdef USE_COMPRESSED
+#include "compress.h"
+#endif
+
#ifdef USE_IMAP
#include "imap.h"
#endif
return (-1);
}
+#ifdef USE_COMPRESSED
+ if (magic == 0 && mutt_can_read_compressed (path))
+ return M_COMPRESSED;
+#endif
+
return (magic);
}
{
struct stat sb;
+#ifdef USE_COMPRESSED
+ /* special case for appending to compressed folders -
+ * even if we can not open them for reading */
+ if (mutt_can_append_compressed (ctx->path))
+ mutt_open_append_compressed (ctx);
+#endif
+
ctx->append = 1;
#ifdef USE_IMAP
ctx->magic = mx_get_magic (path);
+#ifdef USE_COMPRESSED
+ if (ctx->magic == M_COMPRESSED)
+ mutt_open_read_compressed (ctx);
+#endif
+
if(ctx->magic == 0)
mutt_error (_("%s is not a mailbox."), path);
mutt_free_header (&ctx->hdrs[i]);
FREE (&ctx->hdrs);
FREE (&ctx->v2r);
+#ifdef USE_COMPRESSED
+ if (ctx->compressinfo)
+ mutt_fast_close_compressed (ctx);
+#endif
FREE (&ctx->path);
FREE (&ctx->pattern);
if (ctx->limit_pattern)
if (tmp && tmp->new == 0)
mutt_update_mailbox (tmp);
#endif
+
+#ifdef USE_COMPRESSED
+ if (rc == 0 && ctx->compressinfo)
+ return mutt_sync_compressed (ctx);
+#endif
+
return rc;
}
!mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY))
mx_unlink_empty (ctx->path);
+#ifdef USE_COMPRESSED
+ if (ctx->compressinfo && mutt_slow_close_compressed (ctx))
+ return (-1);
+#endif
+
mx_fastclose_mailbox (ctx);
return 0;
ctx->deleted = 0;
}
}
+ else if (ctx->last_tag && ctx->last_tag->deleted)
+ ctx->last_tag = NULL; /* reset last tagged msg now useless */
}
/* really only for IMAP - imap_sync_mailbox results in a call to
{
int rc;
+#ifdef USE_COMPRESSED
+ if (ctx->compressinfo)
+ return mutt_check_mailbox_compressed (ctx);
+#endif
+
if (ctx)
{
if (ctx->locked) lock = 0;