From: Richard Russon Date: Fri, 5 Jul 2019 13:08:07 +0000 (+0100) Subject: drop old refs to struct Header X-Git-Tag: 2019-10-25~146^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f9c8e965bfad83ab6052d75159f06d2ce7d69716;p=neomutt drop old refs to struct Header --- diff --git a/commands.c b/commands.c index 0cb1c0929..9436b2feb 100644 --- a/commands.c +++ b/commands.c @@ -170,7 +170,7 @@ static void update_protected_headers(struct Email *cur) /** * mutt_display_message - Display a message in the pager - * @param cur Header of current message + * @param cur Current Email * @retval 0 Success * @retval -1 Error */ @@ -1287,7 +1287,7 @@ bool mutt_edit_content_type(struct Email *e, struct Body *b, FILE *fp) /** * check_traditional_pgp - Check for an inline PGP content - * @param[in] e Header of message to check + * @param[in] e Email to check * @param[out] redraw Flags if the screen needs redrawing, see #MuttRedrawFlags * @retval true If message contains inline PGP content */ diff --git a/compose.c b/compose.c index 5e5d3bba4..f4a6e7290 100644 --- a/compose.c +++ b/compose.c @@ -265,9 +265,9 @@ static void snd_make_entry(char *buf, size_t buflen, struct Menu *menu, int line /** * redraw_crypt_lines - Update the encryption info in the compose window - * @param msg Header of message + * @param e Email */ -static void redraw_crypt_lines(struct Email *msg) +static void redraw_crypt_lines(struct Email *e) { SET_COLOR(MT_COLOR_COMPOSE_HEADER); mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPT, 0, "%*s", @@ -280,17 +280,17 @@ static void redraw_crypt_lines(struct Email *msg) return; } - if ((msg->security & (SEC_ENCRYPT | SEC_SIGN)) == (SEC_ENCRYPT | SEC_SIGN)) + if ((e->security & (SEC_ENCRYPT | SEC_SIGN)) == (SEC_ENCRYPT | SEC_SIGN)) { SET_COLOR(MT_COLOR_COMPOSE_SECURITY_BOTH); addstr(_("Sign, Encrypt")); } - else if (msg->security & SEC_ENCRYPT) + else if (e->security & SEC_ENCRYPT) { SET_COLOR(MT_COLOR_COMPOSE_SECURITY_ENCRYPT); addstr(_("Encrypt")); } - else if (msg->security & SEC_SIGN) + else if (e->security & SEC_SIGN) { SET_COLOR(MT_COLOR_COMPOSE_SECURITY_SIGN); addstr(_("Sign")); @@ -303,20 +303,20 @@ static void redraw_crypt_lines(struct Email *msg) } NORMAL_COLOR; - if ((msg->security & (SEC_ENCRYPT | SEC_SIGN))) + if ((e->security & (SEC_ENCRYPT | SEC_SIGN))) { - if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP)) + if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP)) { - if ((msg->security & SEC_INLINE)) + if ((e->security & SEC_INLINE)) addstr(_(" (inline PGP)")); else addstr(_(" (PGP/MIME)")); } - else if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME)) + else if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME)) addstr(_(" (S/MIME)")); } - if (C_CryptOpportunisticEncrypt && (msg->security & SEC_OPPENCRYPT)) + if (C_CryptOpportunisticEncrypt && (e->security & SEC_OPPENCRYPT)) addstr(_(" (OppEnc mode)")); mutt_window_clrtoeol(MuttIndexWindow); @@ -324,7 +324,7 @@ static void redraw_crypt_lines(struct Email *msg) mutt_window_clrtoeol(MuttIndexWindow); if (((WithCrypto & APPLICATION_PGP) != 0) && - (msg->security & APPLICATION_PGP) && (msg->security & SEC_SIGN)) + (e->security & APPLICATION_PGP) && (e->security & SEC_SIGN)) { SET_COLOR(MT_COLOR_COMPOSE_HEADER); printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO])); @@ -333,7 +333,7 @@ static void redraw_crypt_lines(struct Email *msg) } if (((WithCrypto & APPLICATION_SMIME) != 0) && - (msg->security & APPLICATION_SMIME) && (msg->security & SEC_SIGN)) + (e->security & APPLICATION_SMIME) && (e->security & SEC_SIGN)) { SET_COLOR(MT_COLOR_COMPOSE_HEADER); printw("%*s", HeaderPadding[HDR_CRYPTINFO], _(Prompts[HDR_CRYPTINFO])); @@ -341,8 +341,8 @@ static void redraw_crypt_lines(struct Email *msg) printw("%s", C_SmimeSignAs ? C_SmimeSignAs : _("")); } - if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME) && - (msg->security & SEC_ENCRYPT) && C_SmimeEncryptWith) + if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME) && + (e->security & SEC_ENCRYPT) && C_SmimeEncryptWith) { SET_COLOR(MT_COLOR_COMPOSE_HEADER); mutt_window_mvprintw(MuttIndexWindow, HDR_CRYPTINFO, 40, "%s", _("Encrypt with: ")); @@ -451,34 +451,34 @@ static void draw_envelope_addr(int line, struct AddressList *al) /** * draw_envelope - Write the email headers to the compose window - * @param msg Header of the message + * @param e Email * @param fcc Fcc field */ -static void draw_envelope(struct Email *msg, char *fcc) +static void draw_envelope(struct Email *e, char *fcc) { - draw_envelope_addr(HDR_FROM, &msg->env->from); + draw_envelope_addr(HDR_FROM, &e->env->from); #ifdef USE_NNTP if (!OptNewsSend) { #endif - draw_envelope_addr(HDR_TO, &msg->env->to); - draw_envelope_addr(HDR_CC, &msg->env->cc); - draw_envelope_addr(HDR_BCC, &msg->env->bcc); + draw_envelope_addr(HDR_TO, &e->env->to); + draw_envelope_addr(HDR_CC, &e->env->cc); + draw_envelope_addr(HDR_BCC, &e->env->bcc); #ifdef USE_NNTP } else { mutt_window_mvprintw(MuttIndexWindow, HDR_TO, 0, "%*s", HeaderPadding[HDR_NEWSGROUPS], Prompts[HDR_NEWSGROUPS]); - mutt_paddstr(W, NONULL(msg->env->newsgroups)); + mutt_paddstr(W, NONULL(e->env->newsgroups)); mutt_window_mvprintw(MuttIndexWindow, HDR_CC, 0, "%*s", HeaderPadding[HDR_FOLLOWUPTO], Prompts[HDR_FOLLOWUPTO]); - mutt_paddstr(W, NONULL(msg->env->followup_to)); + mutt_paddstr(W, NONULL(e->env->followup_to)); if (C_XCommentTo) { mutt_window_mvprintw(MuttIndexWindow, HDR_BCC, 0, "%*s", HeaderPadding[HDR_XCOMMENTTO], Prompts[HDR_XCOMMENTTO]); - mutt_paddstr(W, NONULL(msg->env->x_comment_to)); + mutt_paddstr(W, NONULL(e->env->x_comment_to)); } } #endif @@ -487,9 +487,9 @@ static void draw_envelope(struct Email *msg, char *fcc) mutt_window_mvprintw(MuttIndexWindow, HDR_SUBJECT, 0, "%*s", HeaderPadding[HDR_SUBJECT], _(Prompts[HDR_SUBJECT])); NORMAL_COLOR; - mutt_paddstr(W, NONULL(msg->env->subject)); + mutt_paddstr(W, NONULL(e->env->subject)); - draw_envelope_addr(HDR_REPLYTO, &msg->env->reply_to); + draw_envelope_addr(HDR_REPLYTO, &e->env->reply_to); SET_COLOR(MT_COLOR_COMPOSE_HEADER); mutt_window_mvprintw(MuttIndexWindow, HDR_FCC, 0, "%*s", @@ -498,10 +498,10 @@ static void draw_envelope(struct Email *msg, char *fcc) mutt_paddstr(W, fcc); if (WithCrypto) - redraw_crypt_lines(msg); + redraw_crypt_lines(e); #ifdef MIXMASTER - redraw_mix_line(&msg->chain); + redraw_mix_line(&e->chain); #endif SET_COLOR(MT_COLOR_STATUS); diff --git a/copy.c b/copy.c index 00afa0927..32d56426d 100644 --- a/copy.c +++ b/copy.c @@ -68,7 +68,7 @@ static int copy_delete_attach(struct Body *b, FILE *fp_in, FILE *fp_out, char *d * @retval -1 Failure * * Ok, the only reason for not merging this with mutt_copy_header() below is to - * avoid creating a Header structure in message_handler(). Also, this one will + * avoid creating a Email structure in message_handler(). Also, this one will * wrap headers much more aggressively than the other one. */ int mutt_copy_hdr(FILE *fp_in, FILE *fp_out, LOFF_T off_start, LOFF_T off_end, diff --git a/email/parse.c b/email/parse.c index 6c019e225..4745da6f7 100644 --- a/email/parse.c +++ b/email/parse.c @@ -526,8 +526,8 @@ void mutt_parse_content_type(const char *s, struct Body *ct) * mutt_rfc822_parse_line - Parse an email header * @param env Envelope of the email * @param e Email - * @param line Header field, env.g. 'to' - * @param p Header value, env.g. 'john@example.com' + * @param line Header field, e.g. 'to' + * @param p Header value, e.g. 'john@example.com' * @param user_hdrs If true, save into the Envelope's userhdrs * @param weed If true, perform header weeding (filtering) * @param do_2047 If true, perform RFC2047 decoding of the field diff --git a/email/thread.c b/email/thread.c index 379296104..bb089ba8b 100644 --- a/email/thread.c +++ b/email/thread.c @@ -117,7 +117,7 @@ void thread_hash_destructor(int type, void *obj, intptr_t data) * find_virtual - Find an email with a Virtual message number * @param cur Thread to search * @param reverse If true, reverse the direction of the search - * @retval ptr Matching Header + * @retval ptr Matching Email */ struct Email *find_virtual(struct MuttThread *cur, int reverse) { diff --git a/hcache/serialize.c b/hcache/serialize.c index c90162b5a..61dc57b4e 100644 --- a/hcache/serialize.c +++ b/hcache/serialize.c @@ -571,12 +571,12 @@ void serial_restore_envelope(struct Envelope *env, const unsigned char *d, int * } /** - * mutt_hcache_dump - Serialise a Header object + * mutt_hcache_dump - Serialise an Email object * @param hc Header cache handle * @param e Email to serialise * @param off Size of the binary blob * @param uidvalidity IMAP server identifier - * @retval ptr Binary blob representing the Header + * @retval ptr Binary blob representing the Email * * This function transforms a e into a char so that it is usable by * db_store. @@ -637,11 +637,11 @@ void *mutt_hcache_dump(header_cache_t *hc, const struct Email *e, int *off, unsi } /** - * mutt_hcache_restore - restore a Header from data retrieved from the cache + * mutt_hcache_restore - restore an Email from data retrieved from the cache * @param d Data retrieved using mutt_hcache_fetch or mutt_hcache_fetch_raw * @retval ptr Success, the restored header (can't be NULL) * - * @note The returned Header must be free'd by caller code with + * @note The returned Email must be free'd by caller code with * mutt_email_free(). */ struct Email *mutt_hcache_restore(const unsigned char *d) diff --git a/imap/message.c b/imap/message.c index a6177a9ea..1dc0613e2 100644 --- a/imap/message.c +++ b/imap/message.c @@ -1464,7 +1464,7 @@ int imap_append_message(struct Mailbox *m, struct Message *msg) * already rereading the whole file for length it isn't any more * expensive (it'd be nice if we had the file size passed in already * by the code that writes the file, but that's a lot of changes. - * Ideally we'd have a Header structure with flag info here... */ + * Ideally we'd have an Email structure with flag info here... */ for (last = EOF, len = 0; (c = fgetc(fp)) != EOF; last = c) { if ((c == '\n') && (last != '\r')) @@ -1608,8 +1608,7 @@ int imap_copy_messages(struct Mailbox *m, struct EmailList *el, char *dest, bool mutt_buffer_init(&sync_cmd); mutt_buffer_init(&cmd); - /* Null Header* means copy tagged messages */ - if (!single) + if (!single) /* copy tagged messages */ { /* if any messages have attachments to delete, fall through to FETCH * and APPEND. TODO: Copy what we can with COPY, fall through for the diff --git a/imap/util.c b/imap/util.c index 6366743b7..1e7f2131f 100644 --- a/imap/util.c +++ b/imap/util.c @@ -455,7 +455,7 @@ void imap_hcache_close(struct ImapMboxData *mdata) * imap_hcache_get - Get a header cache entry by its UID * @param mdata Imap Mailbox data * @param uid UID to find - * @retval ptr Email Header + * @retval ptr Email * @retval NULL Failure */ struct Email *imap_hcache_get(struct ImapMboxData *mdata, unsigned int uid) diff --git a/maildir/shared.c b/maildir/shared.c index b91250440..b96856293 100644 --- a/maildir/shared.c +++ b/maildir/shared.c @@ -1180,9 +1180,9 @@ void maildir_canon_filename(struct Buffer *dest, const char *src) } /** - * maildir_update_tables - Update the Header tables + * maildir_update_tables - Update the Email tables * @param ctx Mailbox - * @param index_hint Current email in index + * @param index_hint Current Email in index */ void maildir_update_tables(struct Context *ctx, int *index_hint) { @@ -1491,8 +1491,8 @@ int mh_sync_mailbox_message(struct Mailbox *m, int msgno, header_cache_t *hc) /** * maildir_update_flags - Update the mailbox flags * @param m Mailbox - * @param o Old email Header - * @param n New email Header + * @param o Old Email + * @param n New Email * @retval true If the flags changed * @retval false Otherwise */ diff --git a/main.c b/main.c index 95f096620..3e9e84b54 100644 --- a/main.c +++ b/main.c @@ -961,7 +961,7 @@ int main(int argc, char *argv[], char *envp[]) else sendflags |= SEND_NO_FREE_HEADER; - /* Parse the draft_file into the full Header/Body structure. + /* Parse the draft_file into the full Email/Body structure. * Set SEND_DRAFT_FILE so ci_send_message doesn't overwrite * our msg->content. */ if (draft_file) diff --git a/mutt_body.c b/mutt_body.c index 7474012eb..326a4e9d9 100644 --- a/mutt_body.c +++ b/mutt_body.c @@ -96,7 +96,7 @@ int mutt_body_copy(FILE *fp, struct Body **tgt, struct Body *src) b->d_filename = mutt_str_strdup(src->filename); b->description = mutt_str_strdup(b->description); - /* we don't seem to need the Header structure currently. + /* we don't seem to need the Email structure currently. * XXX this may change in the future */ if (b->email) diff --git a/mutt_header.c b/mutt_header.c index 4f5ebd31a..54bd766c9 100644 --- a/mutt_header.c +++ b/mutt_header.c @@ -163,11 +163,11 @@ int mutt_label_message(struct Mailbox *m, struct EmailList *el) * mutt_edit_headers - Let the user edit the message header and body * @param editor Editor command * @param body File containing message body - * @param msg Header of the message + * @param e Email * @param fcc Buffer for the fcc field * @param fcclen Length of buffer */ -void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, +void mutt_edit_headers(const char *editor, const char *body, struct Email *e, char *fcc, size_t fcclen) { char path[PATH_MAX]; /* tempfile used to edit headers + body */ @@ -186,8 +186,8 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, return; } - mutt_env_to_local(msg->env); - mutt_rfc822_write_header(fp_out, msg->env, NULL, MUTT_WRITE_HEADER_EDITHDRS, false, false); + mutt_env_to_local(e->env); + mutt_rfc822_write_header(fp_out, e->env, NULL, MUTT_WRITE_HEADER_EDITHDRS, false, false); fputc('\n', fp_out); /* tie off the header. */ /* now copy the body of the message. */ @@ -223,7 +223,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, } mutt_file_unlink(body); - mutt_list_free(&msg->env->userhdrs); + mutt_list_free(&e->env->userhdrs); /* Read the temp file back in */ fp_in = fopen(path, "r"); @@ -257,30 +257,30 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, if (!OptNewsSend) #endif { - if (!STAILQ_EMPTY(&msg->env->in_reply_to) && + if (!STAILQ_EMPTY(&e->env->in_reply_to) && (STAILQ_EMPTY(&n->in_reply_to) || (mutt_str_strcmp(STAILQ_FIRST(&n->in_reply_to)->data, - STAILQ_FIRST(&msg->env->in_reply_to)->data) != 0))) + STAILQ_FIRST(&e->env->in_reply_to)->data) != 0))) { - mutt_list_free(&msg->env->references); + mutt_list_free(&e->env->references); } } /* restore old info. */ mutt_list_free(&n->references); - STAILQ_SWAP(&n->references, &msg->env->references, ListNode); + STAILQ_SWAP(&n->references, &e->env->references, ListNode); - mutt_env_free(&msg->env); - msg->env = n; + mutt_env_free(&e->env); + e->env = n; n = NULL; - mutt_expand_aliases_env(msg->env); + mutt_expand_aliases_env(e->env); /* search through the user defined headers added to see if * fcc: or attach: or pgp: was specified */ struct ListNode *np = NULL, *tmp = NULL; - STAILQ_FOREACH_SAFE(np, &msg->env->userhdrs, entries, tmp) + STAILQ_FOREACH_SAFE(np, &e->env->userhdrs, entries, tmp) { bool keep = true; size_t plen; @@ -323,7 +323,7 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, if (body2) { body2->description = mutt_str_strdup(p); - for (parts = msg->content; parts->next; parts = parts->next) + for (parts = e->content; parts->next; parts = parts->next) ; parts->next = body2; } @@ -338,15 +338,15 @@ void mutt_edit_headers(const char *editor, const char *body, struct Email *msg, else if (((WithCrypto & APPLICATION_PGP) != 0) && (plen = mutt_str_startswith(np->data, "pgp:", CASE_IGNORE))) { - msg->security = mutt_parse_crypt_hdr(np->data + plen, false, APPLICATION_PGP); - if (msg->security) - msg->security |= APPLICATION_PGP; + e->security = mutt_parse_crypt_hdr(np->data + plen, false, APPLICATION_PGP); + if (e->security) + e->security |= APPLICATION_PGP; keep = false; } if (!keep) { - STAILQ_REMOVE(&msg->env->userhdrs, np, ListNode, entries); + STAILQ_REMOVE(&e->env->userhdrs, np, ListNode, entries); FREE(&np->data); FREE(&np); } diff --git a/mutt_thread.c b/mutt_thread.c index 391d31bb8..17db4b649 100644 --- a/mutt_thread.c +++ b/mutt_thread.c @@ -1215,7 +1215,7 @@ void mutt_set_vnum(struct Context *ctx) /** * mutt_traverse_thread - Recurse through an email thread, matching messages * @param ctx Mailbox - * @param cur Header of current message + * @param cur Current Email * @param flag Flag to set, see #MuttThreadFlags * @retval num Number of matches */ diff --git a/ncrypt/crypt.c b/ncrypt/crypt.c index cbc7061fb..65bdc0f18 100644 --- a/ncrypt/crypt.c +++ b/ncrypt/crypt.c @@ -159,31 +159,31 @@ bool crypt_valid_passphrase(SecurityFlags flags) /** * mutt_protect - Encrypt and/or sign a message - * @param msg Header of the message + * @param e Email * @param keylist List of keys to encrypt to (space-separated) * @retval 0 Success * @retval -1 Error */ -int mutt_protect(struct Email *msg, char *keylist) +int mutt_protect(struct Email *e, char *keylist) { struct Body *pbody = NULL, *tmp_pbody = NULL; struct Body *tmp_smime_pbody = NULL; struct Body *tmp_pgp_pbody = NULL; - int flags = (WithCrypto & APPLICATION_PGP) ? msg->security : 0; + int flags = (WithCrypto & APPLICATION_PGP) ? e->security : 0; if (!WithCrypto) return -1; - if (!(msg->security & (SEC_ENCRYPT | SEC_SIGN))) + if (!(e->security & (SEC_ENCRYPT | SEC_SIGN))) return 0; - if ((msg->security & SEC_SIGN) && !crypt_valid_passphrase(msg->security)) + if ((e->security & SEC_SIGN) && !crypt_valid_passphrase(e->security)) return -1; - if (((WithCrypto & APPLICATION_PGP) != 0) && ((msg->security & PGP_INLINE) == PGP_INLINE)) + if (((WithCrypto & APPLICATION_PGP) != 0) && ((e->security & PGP_INLINE) == PGP_INLINE)) { - if ((msg->content->type != TYPE_TEXT) || - (mutt_str_strcasecmp(msg->content->subtype, "plain") != 0)) + if ((e->content->type != TYPE_TEXT) || + (mutt_str_strcasecmp(e->content->subtype, "plain") != 0)) { if (query_quadoption(C_PgpMimeAuto, _("Inline PGP can't be used with attachments. " @@ -194,7 +194,7 @@ int mutt_protect(struct Email *msg, char *keylist) return -1; } } - else if (mutt_str_strcasecmp("flowed", mutt_param_get(&msg->content->parameter, "format")) == 0) + else if (mutt_str_strcasecmp("flowed", mutt_param_get(&e->content->parameter, "format")) == 0) { if ((query_quadoption(C_PgpMimeAuto, _("Inline PGP can't be used with format=flowed. " @@ -213,10 +213,10 @@ int mutt_protect(struct Email *msg, char *keylist) mutt_endwin(); puts(_("Invoking PGP...")); } - pbody = crypt_pgp_traditional_encryptsign(msg->content, flags, keylist); + pbody = crypt_pgp_traditional_encryptsign(e->content, flags, keylist); if (pbody) { - msg->content = pbody; + e->content = pbody; return 0; } @@ -237,15 +237,15 @@ int mutt_protect(struct Email *msg, char *keylist) mutt_endwin(); if (WithCrypto & APPLICATION_SMIME) - tmp_smime_pbody = msg->content; + tmp_smime_pbody = e->content; if (WithCrypto & APPLICATION_PGP) - tmp_pgp_pbody = msg->content; + tmp_pgp_pbody = e->content; - if (C_CryptUsePka && (msg->security & SEC_SIGN)) + if (C_CryptUsePka && (e->security & SEC_SIGN)) { /* Set sender (necessary for e.g. PKA). */ const char *mailbox = NULL; - struct Address *from = TAILQ_FIRST(&msg->env->from); + struct Address *from = TAILQ_FIRST(&e->env->from); bool free_from = false; if (!from) @@ -258,9 +258,9 @@ int mutt_protect(struct Email *msg, char *keylist) if (!mailbox && C_EnvelopeFromAddress) mailbox = C_EnvelopeFromAddress->mailbox; - if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME)) + if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME)) crypt_smime_set_sender(mailbox); - else if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP)) + else if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP)) crypt_pgp_set_sender(mailbox); if (free_from) @@ -270,30 +270,30 @@ int mutt_protect(struct Email *msg, char *keylist) if (C_CryptProtectedHeadersWrite) { struct Envelope *protected_headers = mutt_env_new(); - mutt_str_replace(&protected_headers->subject, msg->env->subject); + mutt_str_replace(&protected_headers->subject, e->env->subject); /* Note: if other headers get added, such as to, cc, then a call to * mutt_env_to_intl() will need to be added here too. */ mutt_prepare_envelope(protected_headers, 0); - mutt_env_free(&msg->content->mime_headers); - msg->content->mime_headers = protected_headers; + mutt_env_free(&e->content->mime_headers); + e->content->mime_headers = protected_headers; } - if (msg->security & SEC_SIGN) + if (e->security & SEC_SIGN) { - if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME)) + if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME)) { - tmp_pbody = crypt_smime_sign_message(msg->content); + tmp_pbody = crypt_smime_sign_message(e->content); if (!tmp_pbody) goto bail; pbody = tmp_pbody; tmp_smime_pbody = tmp_pbody; } - if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP) && + if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP) && (!(flags & SEC_ENCRYPT) || C_PgpRetainableSigs)) { - tmp_pbody = crypt_pgp_sign_message(msg->content); + tmp_pbody = crypt_pgp_sign_message(e->content); if (!tmp_pbody) goto bail; @@ -302,16 +302,15 @@ int mutt_protect(struct Email *msg, char *keylist) tmp_pgp_pbody = tmp_pbody; } - if ((WithCrypto != 0) && (msg->security & APPLICATION_SMIME) && - (msg->security & APPLICATION_PGP)) + if ((WithCrypto != 0) && (e->security & APPLICATION_SMIME) && (e->security & APPLICATION_PGP)) { /* here comes the draft ;-) */ } } - if (msg->security & SEC_ENCRYPT) + if (e->security & SEC_ENCRYPT) { - if (((WithCrypto & APPLICATION_SMIME) != 0) && (msg->security & APPLICATION_SMIME)) + if (((WithCrypto & APPLICATION_SMIME) != 0) && (e->security & APPLICATION_SMIME)) { tmp_pbody = crypt_smime_build_smime_entity(tmp_smime_pbody, keylist); if (!tmp_pbody) @@ -320,24 +319,24 @@ int mutt_protect(struct Email *msg, char *keylist) goto bail; } /* free tmp_body if messages was signed AND encrypted ... */ - if ((tmp_smime_pbody != msg->content) && (tmp_smime_pbody != tmp_pbody)) + if ((tmp_smime_pbody != e->content) && (tmp_smime_pbody != tmp_pbody)) { - /* detach and don't delete msg->content, + /* detach and don't delete e->content, * which tmp_smime_pbody->parts after signing. */ tmp_smime_pbody->parts = tmp_smime_pbody->parts->next; - msg->content->next = NULL; + e->content->next = NULL; mutt_body_free(&tmp_smime_pbody); } pbody = tmp_pbody; } - if (((WithCrypto & APPLICATION_PGP) != 0) && (msg->security & APPLICATION_PGP)) + if (((WithCrypto & APPLICATION_PGP) != 0) && (e->security & APPLICATION_PGP)) { pbody = crypt_pgp_encrypt_message(tmp_pgp_pbody, keylist, (flags & SEC_SIGN)); if (!pbody) { /* did we perform a retainable signature? */ - if (flags != msg->security) + if (flags != e->security) { /* remove the outer multipart layer */ tmp_pgp_pbody = mutt_remove_multipart(tmp_pgp_pbody); @@ -352,7 +351,7 @@ int mutt_protect(struct Email *msg, char *keylist) * signatures. */ - if (flags != msg->security) + if (flags != e->security) { tmp_pgp_pbody = mutt_remove_multipart(tmp_pgp_pbody); mutt_body_free(&tmp_pgp_pbody->next); @@ -362,12 +361,12 @@ int mutt_protect(struct Email *msg, char *keylist) if (pbody) { - msg->content = pbody; + e->content = pbody; return 0; } bail: - mutt_env_free(&msg->content->mime_headers); + mutt_env_free(&e->content->mime_headers); return -1; } diff --git a/postpone.c b/postpone.c index 1d938c204..bf1522510 100644 --- a/postpone.c +++ b/postpone.c @@ -210,7 +210,7 @@ static void post_make_entry(char *buf, size_t buflen, struct Menu *menu, int lin /** * select_msg - Create a Menu to select a postponed message - * @retval ptr Email Header + * @retval ptr Email */ static struct Email *select_msg(struct Context *ctx) { diff --git a/send.c b/send.c index 0eae09357..1d064d347 100644 --- a/send.c +++ b/send.c @@ -1059,14 +1059,14 @@ static int envelope_defaults(struct Envelope *env, struct Mailbox *m, /** * generate_body - Create a new email body * @param fp_tmp Stream for outgoing message - * @param msg Header for outgoing message + * @param e Email for outgoing message * @param flags Compose mode, see #SendFlags * @param m Mailbox * @param el List of Emails to use * @retval 0 Success * @retval -1 Error */ -static int generate_body(FILE *fp_tmp, struct Email *msg, SendFlags flags, +static int generate_body(FILE *fp_tmp, struct Email *e, SendFlags flags, struct Mailbox *m, struct EmailList *el) { struct Body *tmp = NULL; @@ -1114,7 +1114,7 @@ static int generate_body(FILE *fp_tmp, struct Email *msg, SendFlags flags, query_quadoption(C_MimeForward, _("Forward as attachment?")); if (ans == MUTT_YES) { - struct Body *last = msg->content; + struct Body *last = e->content; mutt_message(_("Preparing forwarded message...")); @@ -1127,7 +1127,7 @@ static int generate_body(FILE *fp_tmp, struct Email *msg, SendFlags flags, if (last) last->next = tmp; else - msg->content = tmp; + e->content = tmp; } else { @@ -1142,14 +1142,14 @@ static int generate_body(FILE *fp_tmp, struct Email *msg, SendFlags flags, else { last = tmp; - msg->content = tmp; + e->content = tmp; } } } } else if (ans != MUTT_ABORT) { - if (mutt_inline_forward(m, msg, en->email, fp_tmp) != 0) + if (mutt_inline_forward(m, e, en->email, fp_tmp) != 0) return -1; } else @@ -1165,8 +1165,8 @@ static int generate_body(FILE *fp_tmp, struct Email *msg, SendFlags flags, return -1; } - b->next = msg->content; - msg->content = b; + b->next = e->content; + e->content = b; } mutt_clear_error();