]> granicus.if.org Git - neomutt/commitdiff
boolify save message
authorRichard Russon <rich@flatcap.org>
Wed, 18 Jul 2018 22:03:39 +0000 (23:03 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 19 Jul 2018 09:56:47 +0000 (10:56 +0100)
commands.c
commands.h
curs_main.c
imap/imap.c
imap/imap.h
imap/message.c
mx.c
pager.c

index ae03835dda38f4861803825fb38fc831f85d6e7e..7e97d7223cb0505829038288c2f5ea702dcecc0b 100644 (file)
@@ -775,7 +775,7 @@ static void set_copy_flags(struct Header *hdr, int decode, int decrypt,
   }
 }
 
-int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt,
+int mutt_save_message_ctx(struct Header *h, bool delete, bool decode, bool decrypt,
                           struct Context *ctx)
 {
   int cmflags, chflags;
@@ -810,7 +810,7 @@ int mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt,
  * @retval  0 Copy/save was successful
  * @retval -1 Error/abort
  */
-int mutt_save_message(struct Header *h, int delete, int decode, int decrypt)
+int mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt)
 {
   bool need_passphrase = false;
   int app = 0;
index ec60d6381bb7f6b3631834f8a8dc96968cd76671..3002b8d89d2255e9ae3c5b75c57985106afb5838 100644 (file)
@@ -50,8 +50,8 @@ int  mutt_edit_content_type(struct Header *h, struct Body *b, FILE *fp);
 void mutt_enter_command(void);
 void mutt_pipe_message(struct Header *h);
 void mutt_print_message(struct Header *h);
-int  mutt_save_message_ctx(struct Header *h, int delete, int decode, int decrypt, struct Context *ctx);
-int  mutt_save_message(struct Header *h, int delete, int decode, int decrypt);
+int  mutt_save_message_ctx(struct Header *h, bool delete, bool decode, bool decrypt, struct Context *ctx);
+int  mutt_save_message(struct Header *h, bool delete, bool decode, bool decrypt);
 int  mutt_select_sort(int reverse);
 void mutt_shell_escape(void);
 void mutt_version(void);
index c3353821d35b159f3bb5620119946b2a5196ea76..ab839e13c0da6d3c04e2fd446d24aa44cdbb4174 100644 (file)
@@ -2390,11 +2390,11 @@ int mutt_index_menu(void)
       case OP_DECODE_SAVE:
         CHECK_MSGCOUNT;
         CHECK_VISIBLE;
-        if (mutt_save_message(tag ? NULL : CURHDR,
-                              (op == OP_DECRYPT_SAVE) || (op == OP_SAVE) || (op == OP_DECODE_SAVE),
-                              (op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
-                              (op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY) || 0) == 0 &&
-            (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE))
+        if ((mutt_save_message(tag ? NULL : CURHDR,
+                               (op == OP_DECRYPT_SAVE) || (op == OP_SAVE) || (op == OP_DECODE_SAVE),
+                               (op == OP_DECODE_SAVE) || (op == OP_DECODE_COPY),
+                               (op == OP_DECRYPT_SAVE) || (op == OP_DECRYPT_COPY)) == 0) &&
+            ((op == OP_SAVE) || (op == OP_DECODE_SAVE) || (op == OP_DECRYPT_SAVE)))
         {
           menu->redraw |= REDRAW_STATUS;
           if (tag)
index 98cf4b5bcf520cdc79671dc32cc5e54ca8fb0396..c66cfe0eea7aa66d1af7c28e9c128f969a018e6f 100644 (file)
@@ -2441,7 +2441,7 @@ int imap_sync_mailbox(struct Context *ctx, int expunge)
         if (!appendctx)
           mutt_debug(1, "Error opening mailbox in append mode\n");
         else
-          mutt_save_message_ctx(h, 1, 0, 0, appendctx);
+          mutt_save_message_ctx(h, true, false, false, appendctx);
         h->xlabel_changed = false;
       }
     }
index 7744de12ae73a0249e79c920ba6ff054e4a1d8dc..504c22fc5c585fc58653e29fad2fc81c6b6019bb 100644 (file)
@@ -102,7 +102,7 @@ int imap_mailbox_create(const char *folder);
 int imap_mailbox_rename(const char *mailbox);
 
 /* message.c */
-int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int delete);
+int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, bool delete);
 
 /* socket.c */
 void imap_logout_all(void);
index f5ad9f0792304c94ca42408c9aa4223f30bc25ac..41898e21a0d03c12148080277f2fa378546fb4da 100644 (file)
@@ -1368,7 +1368,7 @@ fail:
  * @retval  0 Success
  * @retval  1 Non-fatal error - try fetch/append
  */
-int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, int delete)
+int imap_copy_messages(struct Context *ctx, struct Header *h, char *dest, bool delete)
 {
   struct Buffer cmd, sync_cmd;
   char mbox[PATH_MAX];
diff --git a/mx.c b/mx.c
index 0a9ac28be114fb6a22a18ace5abd469df3960c1f..8178d07505c829fdac4ef150d036b8739527f614 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -843,7 +843,7 @@ int mx_mbox_close(struct Context *ctx, int *index_hint)
         }
       }
 
-      i = imap_copy_messages(ctx, NULL, mbox, 1);
+      i = imap_copy_messages(ctx, NULL, mbox, true);
     }
 
     if (i == 0) /* success */
diff --git a/pager.c b/pager.c
index 8ff9ea5bc0c1d5298d358902ce585a3b20b926bb..ead6aa22c67aba9d53c912aaa4edfa74b682a967 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -3125,11 +3125,11 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e
           break;
         }
         CHECK_MODE(IsHeader(extra));
-        if (mutt_save_message(
-                extra->hdr, (ch == OP_DECRYPT_SAVE) || (ch == OP_SAVE) || (ch == OP_DECODE_SAVE),
-                (ch == OP_DECODE_SAVE) || (ch == OP_DECODE_COPY),
-                (ch == OP_DECRYPT_SAVE) || (ch == OP_DECRYPT_COPY) || 0) == 0 &&
-            (ch == OP_SAVE || ch == OP_DECODE_SAVE || ch == OP_DECRYPT_SAVE))
+        if ((mutt_save_message(
+                 extra->hdr, (ch == OP_DECRYPT_SAVE) || (ch == OP_SAVE) || (ch == OP_DECODE_SAVE),
+                 (ch == OP_DECODE_SAVE) || (ch == OP_DECODE_COPY),
+                 (ch == OP_DECRYPT_SAVE) || (ch == OP_DECRYPT_COPY)) == 0) &&
+            ((ch == OP_SAVE) || (ch == OP_DECODE_SAVE) || (ch == OP_DECRYPT_SAVE)))
         {
           if (Resolve)
           {