less and less cruft: always compile socket support in
[apps/madmutt.git] / mx.c
diff --git a/mx.c b/mx.c
index 6f6f779..760b1dc 100644 (file)
--- a/mx.c
+++ b/mx.c
 #include "keymap.h"
 #include "url.h"
 #include "sidebar.h"
-
-#ifdef USE_COMPRESSED
 #include "compress.h"
-#endif
 
 #ifdef USE_IMAP
 #include "imap/imap.h"
@@ -83,8 +80,6 @@ static list2_t* MailboxFormats = NULL;
  * retry - should retry if unable to lock?
  */
 
-#ifdef DL_STANDALONE
-
 static int invoke_dotlock (const char *path, int dummy, int flags, int retry)
 {
   char cmd[LONG_STRING + _POSIX_PATH_MAX];
@@ -109,12 +104,6 @@ static int invoke_dotlock (const char *path, int dummy, int flags, int retry)
   return mutt_system (cmd);
 }
 
-#else
-
-#define invoke_dotlock dotlock_invoke
-
-#endif
-
 static int dotlock_file (const char *path, int fd, int retry)
 {
   int r;
@@ -393,12 +382,10 @@ static int mx_open_mailbox_append (CONTEXT * ctx, int flags)
 {
   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;
 
@@ -548,10 +535,8 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT * pctx)
   if (!MX_IDX(ctx->magic-1))
     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);
@@ -618,10 +603,10 @@ void mx_fastclose_mailbox (CONTEXT * ctx)
     mutt_free_header (&ctx->hdrs[i]);
   p_delete(&ctx->hdrs);
   p_delete(&ctx->v2r);
-#ifdef USE_COMPRESSED
+
   if (ctx->compressinfo)
     mutt_fast_close_compressed (ctx);
-#endif
+
   p_delete(&ctx->path);
   p_delete(&ctx->pattern);
   if (ctx->limit_pattern)
@@ -642,10 +627,8 @@ static int sync_mailbox (CONTEXT * ctx, int *index_hint)
     /* the 1 is only of interest for IMAP and means EXPUNGE */
     rc = MX_COMMAND(ctx->magic-1,mx_sync_mailbox(ctx,1,index_hint));
 
-#ifdef USE_COMPRESSED
   if (rc == 0 && ctx->compressinfo)
     return mutt_sync_compressed (ctx);
-#endif
 
   return rc;
 }
@@ -892,10 +875,8 @@ static int _mx_close_mailbox (CONTEXT * ctx, int *index_hint)
       !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);
 
@@ -1170,10 +1151,8 @@ MESSAGE *mx_open_new_message (CONTEXT * dest, HEADER * hdr, int flags)
 
 /* check for new mail */
 int mx_check_mailbox (CONTEXT * ctx, int *index_hint, int lock) {
-#ifdef USE_COMPRESSED
   if (ctx->compressinfo)
     return mutt_check_mailbox_compressed (ctx);
-#endif
 
   if (ctx) {
     if (ctx->locked)
@@ -1334,10 +1313,8 @@ void mx_update_context (CONTEXT * ctx, int new_messages)
   for (msgno = ctx->msgcount - new_messages; msgno < ctx->msgcount; msgno++) {
     h = ctx->hdrs[msgno];
 
-    if (WithCrypto) {
-      /* NOTE: this _must_ be done before the check for mailcap! */
-      h->security = crypt_query (h->content);
-    }
+    /* NOTE: this _must_ be done before the check for mailcap! */
+    h->security = crypt_query (h->content);
 
     if (!ctx->pattern) {
       ctx->v2r[ctx->vcount] = msgno;
@@ -1431,9 +1408,7 @@ void mx_init (void) {
 #ifdef USE_NNTP
   list_push_back (&MailboxFormats, (void*) nntp_reg_mx ());
 #endif
-#ifdef USE_COMPRESSED
   list_push_back (&MailboxFormats, (void*) compress_reg_mx ());
-#endif
 #ifdef DEBUG
   /* check module registration for completeness with debug versions */
 #define EXITWITHERR(m) do { fprintf(stderr, "error: incomplete mx module: %s is missing for type %i\n",m,i);exit(1); } while (0)