Skip to content

Commit

Permalink
boolify save message
Browse files Browse the repository at this point in the history
  • Loading branch information
flatcap committed Jul 19, 2018
1 parent d7d6c8b commit 4038dda
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions commands.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions curs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion imap/imap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion imap/imap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion imap/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ int imap_append_message(struct Context *ctx, struct Message *msg)
* @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];
Expand Down
2 changes: 1 addition & 1 deletion mx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
10 changes: 5 additions & 5 deletions pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 4038dda

Please sign in to comment.