diff options
author | David Edmondson <dme@dme.org> | 2018-10-01 17:50:47 +0100 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2018-12-07 08:03:50 -0400 |
commit | 576cff7654a4c3e0c94498977ce7b28ce8f00251 (patch) | |
tree | 7786c79696824794a51620a7925747548d0dd1e2 /notmuch-reply.c | |
parent | 0d0e2869b977a0f2173dac85b3bde4f5ab233700 (diff) |
reply: Include sender as recipient if they were the original recipient
When generating a reply message, if the user was the originator and
only recipient of the original message, include the user as a
recipient of the reply.
Diffstat (limited to 'notmuch-reply.c')
-rw-r--r-- | notmuch-reply.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/notmuch-reply.c b/notmuch-reply.c index 75cf7ecb..d87ec06d 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -369,6 +369,14 @@ add_recipients_from_message (GMimeMessage *reply, } } + /* If no recipients were added but we found one of the user's + * addresses to use as a from address then the message is from the + * user to the user - add the discovered from address to the list + * of recipients so that the reply goes back to the user. + */ + if (n == 0 && from_addr) + g_mime_message_add_recipient (reply, GMIME_ADDRESS_TYPE_TO, NULL, from_addr); + return from_addr; } |