aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-composer-utils.c
diff options
context:
space:
mode:
authorRathin <rathinusa@yahoo.co.in>2011-06-14 20:26:30 +0800
committerMilan Crha <mcrha@redhat.com>2011-06-14 20:26:30 +0800
commitf5794eff3613afe5082ab15bd6dbb14806ce5fdc (patch)
tree375f309c21bea171d89bbeb1252c4038ba0bde58 /mail/em-composer-utils.c
parentde9b1685edf197281c14ce9c1ae8f384866ff0b2 (diff)
downloadgsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar
gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.gz
gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.bz2
gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.lz
gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.xz
gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.zst
gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.zip
Bug #530335 - Allow Reply to selected address only
Diffstat (limited to 'mail/em-composer-utils.c')
-rw-r--r--mail/em-composer-utils.c34
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 ();