X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=send.c;h=2cf6550ad9abda32e60cf5dd4994d74f3cbc54ec;hp=8ba9c3cd49d5eac58d81f0e7ab57d849264547b0;hb=d40d2e47d8033cbf917d09c3865179870897e773;hpb=10b7d54ecaa5c54622bf1239b57fa2e3359db0e1 diff --git a/send.c b/send.c index 8ba9c3c..2cf6550 100644 --- a/send.c +++ b/send.c @@ -11,40 +11,40 @@ # include "config.h" #endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include #include #include #include +#include #include +#include +#include + #include "mutt.h" -#include "enter.h" -#include "mutt_curses.h" #include "rfc3676.h" #include "keymap.h" #include "copy.h" #include "mx.h" -#include "mutt_crypt.h" +#include #include "mutt_idna.h" #include "url.h" #include "attach.h" -#include "lib/debug.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #ifdef USE_NNTP #include "nntp.h" #endif @@ -1072,7 +1072,7 @@ static void fix_end_of_file (const char *data) int mutt_resend_message (FILE * fp, CONTEXT * ctx, HEADER * cur) { - HEADER *msg = mutt_new_header (); + HEADER *msg = header_new(); if (mutt_prepare_template (fp, ctx, msg, cur, 1) < 0) return -1; @@ -1135,7 +1135,7 @@ int ci_send_message (int flags, /* send mode */ */ if (!msg) { - msg = mutt_new_header (); + msg = header_new(); if (flags == SENDPOSTPONED) { if ((flags = @@ -1165,7 +1165,7 @@ int ci_send_message (int flags, /* send mode */ } if (!msg->env) - msg->env = mutt_new_envelope (); + msg->env = envelope_new(); } /* Parse and use an eventual list-post header */ @@ -1261,8 +1261,7 @@ int ci_send_message (int flags, /* send mode */ msg->env->newsgroups = m_strdup(((NNTP_DATA *) ctx->data)->group); #endif - if (!(flags & SENDMAILX) && - !(option (OPTAUTOEDIT) && option (OPTEDITHDRS)) && + if (!(option (OPTAUTOEDIT) && option (OPTEDITHDRS)) && !((flags & SENDREPLY) && option (OPTFASTREPLY))) { if (edit_envelope (msg->env, flags) == -1) goto cleanup; @@ -1311,9 +1310,7 @@ int ci_send_message (int flags, /* send mode */ process_user_header (msg->env); - if (option (OPTSIGONTOP) - && (!(flags & (SENDMAILX | SENDKEY)) && Editor - && m_strcmp(Editor, "builtin") != 0)) + if (option (OPTSIGONTOP) && (!(flags & SENDKEY) && Editor)) append_signature (tempfp); /* include replies/forwarded messages, unless we are given a template */ @@ -1321,9 +1318,7 @@ int ci_send_message (int flags, /* send mode */ && generate_body (tempfp, msg, flags, ctx, cur) == -1) goto cleanup; - if (!option (OPTSIGONTOP) - && (!(flags & (SENDMAILX | SENDKEY)) && Editor - && m_strcmp(Editor, "builtin") != 0)) + if (!option (OPTSIGONTOP) && (!(flags & SENDKEY) && Editor)) append_signature (tempfp); /* @@ -1331,24 +1326,22 @@ int ci_send_message (int flags, /* send mode */ * can take effect. */ - if (!(flags & SENDMAILX)) { - if (option (OPTCRYPTAUTOSIGN)) - msg->security |= SIGN; - if (option (OPTCRYPTAUTOENCRYPT)) - msg->security |= ENCRYPT; - if (option (OPTCRYPTREPLYENCRYPT) && cur && (cur->security & ENCRYPT)) - msg->security |= ENCRYPT; - if (option (OPTCRYPTREPLYSIGN) && cur && (cur->security & SIGN)) - msg->security |= SIGN; - if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur - && (cur->security & ENCRYPT)) - msg->security |= SIGN; - if (msg->security & (ENCRYPT | SIGN)) { - if (option (OPTPGPAUTOINLINE)) - msg->security |= INLINE; - if (option (OPTPGPREPLYINLINE) && cur && (cur->security & INLINE)) - msg->security |= INLINE; - } + if (option (OPTCRYPTAUTOSIGN)) + msg->security |= SIGN; + if (option (OPTCRYPTAUTOENCRYPT)) + msg->security |= ENCRYPT; + if (option (OPTCRYPTREPLYENCRYPT) && cur && (cur->security & ENCRYPT)) + msg->security |= ENCRYPT; + if (option (OPTCRYPTREPLYSIGN) && cur && (cur->security & SIGN)) + msg->security |= SIGN; + if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur + && (cur->security & ENCRYPT)) + msg->security |= SIGN; + if (msg->security & (ENCRYPT | SIGN)) { + if (option (OPTPGPAUTOINLINE)) + msg->security |= INLINE; + if (option (OPTPGPREPLYINLINE) && cur && (cur->security & INLINE)) + msg->security |= INLINE; } if (msg->security) { @@ -1404,11 +1397,7 @@ int ci_send_message (int flags, /* send mode */ if (!(flags & SENDKEY)) safe_fclose (&tempfp); - if (flags & SENDMAILX) { - if (mutt_builtin_editor (msg->content->filename, msg, cur) == -1) - goto cleanup; - } - else if (!(flags & SENDBATCH)) { + if (!(flags & SENDBATCH)) { struct stat st; time_t mtime = mutt_decrease_mtime (msg->content->filename, NULL); @@ -1433,9 +1422,7 @@ int ci_send_message (int flags, /* send mode */ if (mutt_needs_mailcap (msg->content)) { if (!mutt_edit_attachment (msg->content)) goto cleanup; - } else if (!Editor || m_strcmp("builtin", Editor) == 0) - mutt_builtin_editor (msg->content->filename, msg, cur); - else if (option (OPTEDITHDRS)) { + } else if (option (OPTEDITHDRS)) { mutt_env_to_local (msg->env); mutt_edit_headers (Editor, msg->content->filename, msg, fcc, sizeof (fcc)); @@ -1494,7 +1481,7 @@ int ci_send_message (int flags, /* send mode */ mutt_update_encoding (msg->content); - if (!(flags & (SENDMAILX | SENDBATCH))) { + if (!(flags & SENDBATCH)) { main_loop: fcc_error = 0; /* reset value since we may have failed before */ @@ -1659,7 +1646,7 @@ int ci_send_message (int flags, /* send mode */ && (msg->content->parts != clear_content)) free_clear_content = 1; - if (!option (OPTNOCURSES) && !(flags & SENDMAILX)) + if (!option (OPTNOCURSES)) mutt_message _("Sending message..."); mutt_prepare_envelope (msg->env, 1); @@ -1678,10 +1665,8 @@ int ci_send_message (int flags, /* send mode */ * I'd like to think a bit more about this before including it. */ -#ifdef USE_IMAP if ((flags & SENDBATCH) && fcc[0] && mx_get_magic (fcc) == M_IMAP) fcc[0] = '\0'; -#endif if (*fcc && m_strcmp("/dev/null", fcc) != 0) { BODY *tmpbody = msg->content; @@ -1788,15 +1773,15 @@ int ci_send_message (int flags, /* send mode */ goto cleanup; } } - else if (!option (OPTNOCURSES) && !(flags & SENDMAILX)) + else if (!option (OPTNOCURSES)) mutt_message (i != 0 ? _("Sending in background.") : #ifdef USE_NNTP (flags & SENDNEWS) ? _("Article posted.") : - _("Mail sent.")); + _("Mail sent.") #else - _("Mail sent.")); + _("Mail sent.") #endif - + ); if (msg->security & ENCRYPT) p_delete(&pgpkeylist); @@ -1826,7 +1811,7 @@ cleanup: } safe_fclose (&tempfp); - mutt_free_header (&msg); + header_delete(&msg); return rv; }