From 70646faa9f9f5418d31e3e293768bc8366873000 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 29 Jun 2000 03:18:39 +0000 Subject: add default subjects * mail-format.c (mail_generate_forward): add default subjects svn path=/trunk/; revision=3784 --- mail/ChangeLog | 2 ++ mail/mail-format.c | 17 ++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'mail') 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 + * 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; } -- cgit v1.2.3