From: Richard Russon Date: Fri, 15 Feb 2019 23:09:08 +0000 (+0000) Subject: boolify imap_set_flags() X-Git-Tag: 2019-10-25~369^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58e3a383ac16bc6710011f4f01baafc15543d888;p=neomutt boolify imap_set_flags() --- diff --git a/imap/command.c b/imap/command.c index c74f19113..a642b444b 100644 --- a/imap/command.c +++ b/imap/command.c @@ -388,7 +388,7 @@ static void cmd_parse_fetch(struct ImapAccountData *adata, char *s) struct Email *e = NULL; char *flags = NULL; int uid_checked = 0; - int server_changes = 0; + bool server_changes = false; struct ImapMboxData *mdata = imap_mdata_get(adata->mailbox); diff --git a/imap/imap_private.h b/imap/imap_private.h index 5c41a26c9..c6049ad60 100644 --- a/imap/imap_private.h +++ b/imap/imap_private.h @@ -288,7 +288,7 @@ int imap_cmd_idle(struct ImapAccountData *adata); void imap_edata_free(void **ptr); struct ImapEmailData *imap_edata_get(struct Email *e); int imap_read_headers(struct Mailbox *m, unsigned int msn_begin, unsigned int msn_end, bool initial_download); -char *imap_set_flags(struct Mailbox *m, struct Email *e, char *s, int *server_changes); +char *imap_set_flags(struct Mailbox *m, struct Email *e, char *s, bool *server_changes); int imap_cache_del(struct Mailbox *m, struct Email *e); int imap_cache_clean(struct Mailbox *m); int imap_append_message(struct Mailbox *m, struct Message *msg); diff --git a/imap/message.c b/imap/message.c index 45c8c2e34..42db34b02 100644 --- a/imap/message.c +++ b/imap/message.c @@ -652,7 +652,7 @@ static void imap_fetch_msn_seqset(struct Buffer *b, struct ImapAccountData *adat * @param[in] m Mailbox * @param[in] e Email * @param[in] local_changes Has the local mailbox been changed? - * @param[out] server_changes Set to 1 if the flag has changed + * @param[out] server_changes Set to true if the flag has changed * @param[in] flag_name Flag to check, e.g. #MUTT_FLAG * @param[in] old_hd_flag Old header flags * @param[in] new_hd_flag New header flags @@ -663,7 +663,7 @@ static void imap_fetch_msn_seqset(struct Buffer *b, struct ImapAccountData *adat * made. */ static void set_changed_flag(struct Mailbox *m, struct Email *e, - int local_changes, int *server_changes, int flag_name, + int local_changes, bool *server_changes, int flag_name, int old_hd_flag, int new_hd_flag, int h_flag) { /* If there are local_changes, we only want to note if the server @@ -678,7 +678,7 @@ static void set_changed_flag(struct Mailbox *m, struct Email *e, return; if (server_changes) - *server_changes = 1; + *server_changes = true; /* Local changes have priority */ if (!local_changes) @@ -1749,7 +1749,7 @@ int imap_cache_clean(struct Mailbox *m) * @param[in] m Imap Selected Mailbox * @param[in] e Email * @param[in] s Command string - * @param[out] server_changes Flags have changed + * @param[out] server_changes Set to true if the flags have changed * @retval ptr The end of flags string * @retval NULL Failure * @@ -1762,7 +1762,7 @@ int imap_cache_clean(struct Mailbox *m) * case of e->changed, if a change to a flag _would_ have been * made. */ -char *imap_set_flags(struct Mailbox *m, struct Email *e, char *s, int *server_changes) +char *imap_set_flags(struct Mailbox *m, struct Email *e, char *s, bool *server_changes) { struct ImapAccountData *adata = imap_adata_get(m); if (!adata || adata->mailbox != m)