aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog2
-rw-r--r--mail/mail-format.c17
2 files changed, 18 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 161c15ca21..021d80affd 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,7 @@
2000-06-28 Dan Winship <danw@helixcode.com>
+ * mail-format.c (mail_generate_forward): add default subjects
+
* component-factory.c (create_folder): Refuse to create folders
not of type "mail", and correctly create an empty "mbox" folder
for new folders in /local.
diff --git a/mail/mail-format.c b/mail/mail-format.c
index 6f55ce3b38..e2fef22180 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -1444,6 +1444,8 @@ mail_generate_forward (CamelMimeMessage *mime_message,
{
EMsgComposer *composer;
CamelMimePart *part;
+ const char *from, *subject;
+ char *fwd_subj;
if (!forward_as_attachment)
g_warning ("Forward as non-attachment not implemented.");
@@ -1462,7 +1464,20 @@ mail_generate_forward (CamelMimeMessage *mime_message,
e_msg_composer_attach (composer, part);
gtk_object_unref (GTK_OBJECT (part));
- /* FIXME: should we default a subject? */
+ from = camel_mime_message_get_from (mime_message);
+ subject = camel_mime_message_get_subject (mime_message);
+ if (from) {
+ if (subject && *subject) {
+ while (*subject == ' ')
+ subject++;
+ fwd_subj = g_strdup_printf ("[%s] %s", from, subject);
+ } else {
+ fwd_subj = g_strdup_printf ("[%s] (forwarded message)",
+ from);
+ }
+ }
+ e_msg_composer_set_headers (composer, NULL, NULL, NULL, fwd_subj);
+ g_free (fwd_subj);
return composer;
}