diff options
author | Rathin <rathinusa@yahoo.co.in> | 2011-06-14 20:26:30 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-06-14 20:26:30 +0800 |
commit | f5794eff3613afe5082ab15bd6dbb14806ce5fdc (patch) | |
tree | 375f309c21bea171d89bbeb1252c4038ba0bde58 /mail/e-mail-reader-utils.c | |
parent | de9b1685edf197281c14ce9c1ae8f384866ff0b2 (diff) | |
download | gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.gz gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.tar.zst gsoc2013-evolution-f5794eff3613afe5082ab15bd6dbb14806ce5fdc.zip |
Bug #530335 - Allow Reply to selected address only
Diffstat (limited to 'mail/e-mail-reader-utils.c')
-rw-r--r-- | mail/e-mail-reader-utils.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 178b6aefcf..fe4e406688 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -787,6 +787,7 @@ e_mail_reader_reply_to_message (EMailReader *reader, EMFormatHTML *formatter; GtkWidget *message_list; CamelMimeMessage *new_message; + CamelInternetAddress *address = NULL; CamelFolder *folder; EMailReplyStyle reply_style; EWebView *web_view; @@ -812,6 +813,29 @@ e_mail_reader_reply_to_message (EMailReader *reader, web_view = em_format_html_get_web_view (formatter); + if (reply_type == E_MAIL_REPLY_TO_RECIPIENT) { + const gchar *uri; + + uri = e_web_view_get_selected_uri (web_view); + + if (uri) { + CamelURL *curl; + + curl = camel_url_new (uri, NULL); + + if (curl && curl->path && *curl->path) { + address = camel_internet_address_new (); + if (camel_address_decode (CAMEL_ADDRESS (address), curl->path) < 0) { + g_object_unref (address); + address = NULL; + } + } + + if (curl) + camel_url_free (curl); + } + } + uid = MESSAGE_LIST (message_list)->cursor_uid; g_return_if_fail (uid != NULL); @@ -859,7 +883,10 @@ e_mail_reader_reply_to_message (EMailReader *reader, em_utils_reply_to_message ( shell, new_message, folder, uid, - reply_type, reply_style, NULL); + reply_type, reply_style, NULL, address); + + if (address) + g_object_unref (address); g_object_unref (new_message); @@ -870,7 +897,10 @@ e_mail_reader_reply_to_message (EMailReader *reader, whole_message: em_utils_reply_to_message ( shell, src_message, folder, uid, - reply_type, reply_style, EM_FORMAT (formatter)); + reply_type, reply_style, EM_FORMAT (formatter), address); + + if (address) + g_object_unref (address); } static void |