diff options
author | Rathin <rathinusa@yahoo.co.in> | 2011-06-14 20:26:30 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:42:27 +0800 |
commit | 075e48579b3012928bc715e9e3058f16ffa52f3f (patch) | |
tree | 52f1182dfcc2605c2410576122f644f800b47fa4 /mail/em-composer-utils.c | |
parent | 5de8b9f77e7bbe189a160e345bb452b648392919 (diff) | |
download | gsoc2013-evolution-075e48579b3012928bc715e9e3058f16ffa52f3f.tar.gz gsoc2013-evolution-075e48579b3012928bc715e9e3058f16ffa52f3f.tar.zst gsoc2013-evolution-075e48579b3012928bc715e9e3058f16ffa52f3f.zip |
Bug #530335 - Allow Reply to selected address only
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r-- | mail/em-composer-utils.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 841fb77d6b..2dcc6872af 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -2389,6 +2389,30 @@ get_reply_from (CamelMimeMessage *message, } static void +get_reply_recipient (CamelMimeMessage *message, + CamelInternetAddress *to, + CamelNNTPAddress *postto, + CamelInternetAddress *address) +{ + const gchar *name, *addr, *posthdr; + gint i; + + /* check whether there is a 'Newsgroups: ' header in there */ + if (postto + && ((posthdr = camel_medium_get_header((CamelMedium *)message, "Followup-To")) + || (posthdr = camel_medium_get_header((CamelMedium *)message, "Newsgroups")))) { + camel_address_decode ((CamelAddress *)postto, posthdr); + return; + } + + if (address) { + for (i = 0; camel_internet_address_get (address, i, &name, &addr); i++) + camel_internet_address_add (to, name, addr); + } + +} + +static void concat_unique_addrs (CamelInternetAddress *dest, CamelInternetAddress *src, GHashTable *rcpt_hash) @@ -2792,6 +2816,7 @@ em_utils_construct_composer_text (CamelMimeMessage *message, EMFormat *source) * @type: the type of reply to create * @style: the reply style to use * @source: source to inherit view settings from + * @address: used for E_MAIL_REPLY_TO_RECIPIENT @type * * Creates a new composer ready to reply to @message. * @@ -2805,7 +2830,8 @@ em_utils_reply_to_message (EShell *shell, const gchar *message_uid, EMailReplyType type, EMailReplyStyle style, - EMFormat *source) + EMFormat *source, + CamelInternetAddress *address) { CamelInternetAddress *to, *cc; CamelNNTPAddress *postto = NULL; @@ -2829,6 +2855,12 @@ em_utils_reply_to_message (EShell *shell, get_reply_from (message, to, postto); break; + case E_MAIL_REPLY_TO_RECIPIENT: + if (folder) + postto = camel_nntp_address_new (); + + get_reply_recipient (message, to, postto, address); + break; case E_MAIL_REPLY_TO_SENDER: if (folder) postto = camel_nntp_address_new (); |