From 600a58dcd2cdc0aee808b72795b9e4dfe2cc655c Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Wed, 13 May 2009 14:20:45 +0200 Subject: [PATCH] Don't set 'replied' flag if user changes References/IRT. Closes #2044. --- ChangeLog | 10 ++++++++++ send.c | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45db1ed7f..a9fca3c1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-05-13 14:19 +0200 Rocco Rutte (c46e734a9f9f) + + * mutt.h, muttlib.c: Add mutt_find_list() to lookup data in lists + +2009-05-13 12:52 +0200 Rocco Rutte (19e62bd1549b) + + * ChangeLog, alias.c, crypt-gpgme.c, group.c, mbox.c, pgp.c, query.c, + rfc822.c, rfc822.h, send.c, smime.c: Prune empty address groups when + preparing replies. Closes #2875. + 2009-05-13 12:21 +0200 Rocco Rutte (ce0e5c895032) * mbox.c: Actually reopen mbox/mmdf files in case we find diff --git a/send.c b/send.c index 768fc2357..a8cb08891 100644 --- a/send.c +++ b/send.c @@ -1088,6 +1088,12 @@ int mutt_resend_message (FILE *fp, CONTEXT *ctx, HEADER *cur) return ci_send_message (SENDRESEND, msg, NULL, ctx, cur); } +static int is_reply (HEADER *reply, HEADER *orig) +{ + return mutt_find_list (orig->env->references, reply->env->message_id) || + mutt_find_list (orig->env->in_reply_to, reply->env->message_id); +} + int ci_send_message (int flags, /* send mode */ HEADER *msg, /* template to use for new message */ @@ -1792,15 +1798,18 @@ full_fcc: if (WithCrypto && free_clear_content) mutt_free_body (&clear_content); + /* set 'replied' flag only if the user didn't change/remove + In-Reply-To: and References: headers during edit */ if (flags & SENDREPLY) { if (cur && ctx) - mutt_set_flag (ctx, cur, M_REPLIED, 1); + mutt_set_flag (ctx, cur, M_REPLIED, is_reply (cur, msg)); else if (!(flags & SENDPOSTPONED) && ctx && ctx->tagged) { for (i = 0; i < ctx->vcount; i++) if (ctx->hdrs[ctx->v2r[i]]->tagged) - mutt_set_flag (ctx, ctx->hdrs[ctx->v2r[i]], M_REPLIED, 1); + mutt_set_flag (ctx, ctx->hdrs[ctx->v2r[i]], M_REPLIED, + is_reply (ctx->hdrs[ctx->v2r[i]], msg)); } } -- 2.40.0