X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=send.c;h=7b4b9bc4da068f0cbf55f5e637929b7c66a1073f;hp=f98e32ba93fb6e47f656696d5b3af8736fd5db11;hb=93b012884de4ca5e1f2550f767d0b8680b9c0e9f;hpb=cfc49a0d8c3ac2c0bd4b217026d0740c55f2e5db diff --git a/send.c b/send.c index f98e32b..7b4b9bc 100644 --- a/send.c +++ b/send.c @@ -22,7 +22,6 @@ #include "mutt.h" #include "enter.h" #include "mutt_curses.h" -#include "rfc2047.h" #include "rfc3676.h" #include "keymap.h" #include "copy.h" @@ -170,11 +169,11 @@ static address_t *find_mailing_lists (address_t * t, address_t * c) for (; t; t = t->next) { if (mutt_is_mail_list (t) && !t->group) { if (top) { - ptr->next = rfc822_cpy_adr_real (t); + ptr->next = address_dup (t); ptr = ptr->next; } else - ptr = top = rfc822_cpy_adr_real (t); + ptr = top = address_dup (t); } } } @@ -297,7 +296,7 @@ static int edit_envelope (ENVELOPE * en, int flags) return (-1); } - str_replace (&en->subject, buf); + m_strreplace(&en->subject, buf); return 0; } @@ -351,7 +350,7 @@ static void process_user_header (ENVELOPE * env) env->reply_to = rfc822_parse_adrlist (env->reply_to, uh->data + 9); } else if (ascii_strncasecmp ("message-id:", uh->data, 11) == 0) - str_replace (&env->message_id, uh->data + 11); + m_strreplace(&env->message_id, uh->data + 11); else if (ascii_strncasecmp ("to:", uh->data, 3) != 0 && ascii_strncasecmp ("cc:", uh->data, 3) != 0 && ascii_strncasecmp ("bcc:", uh->data, 4) != 0 && @@ -473,10 +472,9 @@ static int include_reply (CONTEXT * ctx, HEADER * cur, FILE * out) static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) { char prompt[STRING]; - address_t *tmp; if (flags && env->mail_followup_to && hmfupto == M_YES) { - rfc822_append (to, env->mail_followup_to); + address_list_append(to, address_list_dup(env->mail_followup_to)); return 0; } @@ -494,9 +492,7 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) _("Message came from a mailing list. List-reply to mailing list?"))) { case M_YES: - tmp = find_mailing_lists (env->to, env->cc); - rfc822_append (to, tmp); - address_delete (&tmp); + address_list_append(to, find_mailing_lists (env->to, env->cc)); return 0; case -1: return -1; /* abort */ @@ -505,7 +501,7 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) if (!option (OPTREPLYSELF) && mutt_addr_is_user (env->from)) { /* mail is from the user, assume replying to recipients */ - rfc822_append (to, env->to); + address_list_append(to, address_list_dup(env->to)); } else if (env->reply_to) { if ((mutt_addrcmp (env->from, env->reply_to) && !env->reply_to->next) || @@ -521,7 +517,7 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) * in his From header. * */ - rfc822_append (to, env->from); + address_list_append(to, address_list_dup(env->from)); } else if (!(mutt_addrcmp (env->from, env->reply_to) && !env->reply_to->next) && quadoption (OPT_REPLYTO) != M_YES) { @@ -534,11 +530,11 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) env->reply_to->mailbox, env->reply_to->next ? ",..." : ""); switch (query_quadoption (OPT_REPLYTO, prompt)) { case M_YES: - rfc822_append (to, env->reply_to); + address_list_append(to, address_list_dup(env->reply_to)); break; case M_NO: - rfc822_append (to, env->from); + address_list_append(to, address_list_dup(env->from)); break; default: @@ -546,10 +542,10 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) } } else - rfc822_append (to, env->reply_to); + address_list_append(to, address_list_dup(env->reply_to)); } else - rfc822_append (to, env->from); + address_list_append(to, address_list_dup(env->from)); return (0); } @@ -557,7 +553,6 @@ static int default_to (address_t ** to, ENVELOPE * env, int flags, int hmfupto) int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags) { char prompt[STRING]; - address_t *tmp; int hmfupto = -1; if ((flags & (SENDLISTREPLY | SENDGROUPREPLY)) && in->mail_followup_to) { @@ -570,9 +565,7 @@ int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags) } if (flags & SENDLISTREPLY) { - tmp = find_mailing_lists (in->to, in->cc); - rfc822_append (&out->to, tmp); - address_delete (&tmp); + address_list_append(&out->to, find_mailing_lists(in->to, in->cc)); if (in->mail_followup_to && hmfupto == M_YES && default_to (&out->cc, in, flags & SENDLISTREPLY, hmfupto) == -1) @@ -583,10 +576,10 @@ int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags) return (-1); /* abort */ if ((flags & SENDGROUPREPLY) - && (!in->mail_followup_to || hmfupto != M_YES)) { - /* if(!mutt_addr_is_user(in->to)) */ - rfc822_append (&out->cc, in->to); - rfc822_append (&out->cc, in->cc); + && (!in->mail_followup_to || hmfupto != M_YES)) + { + address_t **tmp = address_list_append(&out->cc, address_list_dup(in->to)); + address_list_append(tmp, address_list_dup(in->cc)); } } return 0; @@ -640,7 +633,7 @@ void mutt_make_forward_subject (ENVELOPE * env, CONTEXT * ctx, HEADER * cur) /* set the default subject for the message. */ mutt_make_string (buffer, sizeof (buffer), NONULL (ForwFmt), ctx, cur); - str_replace (&env->subject, buffer); + m_strreplace(&env->subject, buffer); } void mutt_make_misc_reply_headers (ENVELOPE * env, CONTEXT * ctx, @@ -881,7 +874,6 @@ static int generate_body (FILE * tempfp, /* stream for outgoing message * void mutt_set_followup_to (ENVELOPE * e) { - address_t *t = NULL; address_t *from; /* @@ -901,13 +893,14 @@ void mutt_set_followup_to (ENVELOPE * e) if (!e->mail_followup_to) { if (mutt_is_list_cc (0, e->to, e->cc)) { + address_t **tmp; /* * this message goes to known mailing lists, so create a proper * mail-followup-to header */ - t = rfc822_append (&e->mail_followup_to, e->to); - rfc822_append (&t, e->cc); + tmp = address_list_append(&e->mail_followup_to, address_list_dup(e->to)); + address_list_append(tmp, address_list_dup(e->cc)); } /* remove ourselves from the mail-followup-to header */ @@ -922,22 +915,19 @@ void mutt_set_followup_to (ENVELOPE * e) if (e->mail_followup_to && !mutt_is_list_recipient (0, e->to, e->cc)) { if (e->reply_to) - from = rfc822_cpy_adr (e->reply_to); + from = address_list_dup (e->reply_to); else if (e->from) - from = rfc822_cpy_adr (e->from); + from = address_list_dup (e->from); else from = mutt_default_from (); if (from) { - /* Normally, this loop will not even be entered. */ - for (t = from; t && t->next; t = t->next); - - t->next = e->mail_followup_to; /* t cannot be NULL at this point. */ + address_list_append(&from->next, e->mail_followup_to); e->mail_followup_to = from; } } - e->mail_followup_to = mutt_remove_duplicates (e->mail_followup_to); + e->mail_followup_to = mutt_remove_duplicates(e->mail_followup_to); } } @@ -963,7 +953,7 @@ static address_t *set_reverse_name (ENVELOPE * env) if (!tmp && mutt_addr_is_user (env->from)) tmp = env->from; if (tmp) { - tmp = rfc822_cpy_adr_real (tmp); + tmp = address_dup (tmp); if (!option (OPTREVREAL)) p_delete(&tmp->personal); if (!tmp->personal) @@ -983,7 +973,7 @@ address_t *mutt_default_from (void) */ if (From) - adr = rfc822_cpy_adr_real (From); + adr = address_dup (From); else if (option (OPTUSEDOMAIN)) { adr = address_new (); adr->mailbox = p_new(char, m_strlen(Username) + m_strlen(fqdn) + 2);