aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/em-composer-utils.c14
-rw-r--r--mail/em-composer-utils.h5
-rw-r--r--plugins/templates/templates.c15
3 files changed, 25 insertions, 9 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c
index 15cbebc767..8f08cf039e 100644
--- a/mail/em-composer-utils.c
+++ b/mail/em-composer-utils.c
@@ -1562,11 +1562,11 @@ emu_update_composers_security (EMsgComposer *composer,
}
}
-static void
-get_real_folder_uri_and_message_uid (CamelFolder *folder,
- const gchar *uid,
- gchar **folder_uri,
- gchar **message_uid)
+void
+em_utils_get_real_folder_uri_and_message_uid (CamelFolder *folder,
+ const gchar *uid,
+ gchar **folder_uri,
+ gchar **message_uid)
{
g_return_if_fail (folder != NULL);
g_return_if_fail (uid != NULL);
@@ -1764,7 +1764,7 @@ forward_non_attached (EShell *shell,
if (uid != NULL) {
gchar *folder_uri = NULL, *tmp_message_uid = NULL;
- get_real_folder_uri_and_message_uid (folder, uid, &folder_uri, &tmp_message_uid);
+ em_utils_get_real_folder_uri_and_message_uid (folder, uid, &folder_uri, &tmp_message_uid);
e_msg_composer_set_source_headers (
composer, folder_uri, tmp_message_uid,
@@ -2998,7 +2998,7 @@ em_utils_reply_to_message (EShell *shell,
if (folder != NULL) {
gchar *folder_uri = NULL, *tmp_message_uid = NULL;
- get_real_folder_uri_and_message_uid (folder, message_uid, &folder_uri, &tmp_message_uid);
+ em_utils_get_real_folder_uri_and_message_uid (folder, message_uid, &folder_uri, &tmp_message_uid);
e_msg_composer_set_source_headers (
composer, folder_uri, tmp_message_uid, flags);
diff --git a/mail/em-composer-utils.h b/mail/em-composer-utils.h
index 93d87bfb2e..cda63d1458 100644
--- a/mail/em-composer-utils.h
+++ b/mail/em-composer-utils.h
@@ -84,6 +84,11 @@ EDestination ** em_utils_camel_address_to_destination
(CamelInternetAddress *iaddr);
void em_configure_new_composer (EMsgComposer *composer,
EMailSession *session);
+void em_utils_get_real_folder_uri_and_message_uid
+ (CamelFolder *folder,
+ const gchar *uid,
+ gchar **folder_uri,
+ gchar **message_uid);
G_END_DECLS
diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c
index 8aa33f8605..0738e475c2 100644
--- a/plugins/templates/templates.c
+++ b/plugins/templates/templates.c
@@ -56,6 +56,7 @@ struct _AsyncContext {
EMailReader *reader;
CamelMimeMessage *message;
CamelFolder *template_folder;
+ gchar *source_folder_uri;
gchar *message_uid;
gchar *template_message_uid;
};
@@ -117,6 +118,7 @@ async_context_free (AsyncContext *context)
if (context->template_folder != NULL)
g_object_unref (context->template_folder);
+ g_free (context->source_folder_uri);
g_free (context->message_uid);
g_free (context->template_message_uid);
@@ -790,6 +792,7 @@ create_new_message (CamelFolder *folder,
EShell *shell;
const gchar *message_uid;
gint i;
+ EMsgComposer *composer;
GError *error = NULL;
CamelMimePart *template_part = NULL;
@@ -925,7 +928,10 @@ create_new_message (CamelFolder *folder,
template, CAMEL_RECIPIENT_TYPE_BCC));
/* Create the composer */
- em_utils_edit_message (shell, folder, new, message_uid);
+ composer = E_MSG_COMPOSER (em_utils_edit_message (shell, folder, new, message_uid));
+ if (composer && context->source_folder_uri && context->message_uid)
+ e_msg_composer_set_source_headers (composer, context->source_folder_uri,
+ context->message_uid, CAMEL_MESSAGE_ANSWERED | CAMEL_MESSAGE_SEEN);
g_object_unref (template);
g_object_unref (new_multipart);
@@ -1015,9 +1021,14 @@ action_reply_with_template_cb (GtkAction *action,
context->activity = activity;
context->reader = g_object_ref (reader);
context->template_folder = g_object_ref (template_folder);
- context->message_uid = g_strdup (message_uid);
context->template_message_uid = g_strdup (template_message_uid);
+ em_utils_get_real_folder_uri_and_message_uid (folder, message_uid,
+ &context->source_folder_uri, &context->message_uid);
+
+ if (!context->message_uid)
+ context->message_uid = g_strdup (message_uid);
+
camel_folder_get_message (
folder, message_uid, G_PRIORITY_DEFAULT,
cancellable, (GAsyncReadyCallback)