aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-07-09 07:40:06 +0800
committerDan Winship <danw@src.gnome.org>2000-07-09 07:40:06 +0800
commit2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a (patch)
tree5baa321bd991a0bade8991e2561a33d64d18bc16 /mail
parent542183e4b94e68dee17c5193a13d588beb43991a (diff)
downloadgsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.tar
gsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.tar.gz
gsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.tar.bz2
gsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.tar.lz
gsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.tar.xz
gsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.tar.zst
gsoc2013-evolution-2f2ff6d4cc13fccff5bdc3a0370b101cf539fb2a.zip
Deal with having multiple selected messages.
* mail-ops.c (forward_msg): Deal with having multiple selected messages. * mail-format.c (mail_generate_forward): Removed. (Integrated into forward_msg) svn path=/trunk/; revision=3982
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-format.c45
-rw-r--r--mail/mail-ops.c57
-rw-r--r--mail/mail.h4
4 files changed, 63 insertions, 51 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 90fd806534..5651f9de24 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2000-07-08 Dan Winship <danw@helixcode.com>
+
+ * mail-ops.c (forward_msg): Deal with having multiple selected
+ messages.
+
+ * mail-format.c (mail_generate_forward): Removed. (Integrated into
+ forward_msg)
+
2000-07-08 Jeffrey Stedfast <fejj@helixcode.com>
* message-list.c (build_tree): Small fix to stop uid data from
diff --git a/mail/mail-format.c b/mail/mail-format.c
index 909eced8ca..56f361aebf 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -1437,48 +1437,3 @@ mail_generate_reply (CamelMimeMessage *message, gboolean to_all)
return composer;
}
-
-EMsgComposer *
-mail_generate_forward (CamelMimeMessage *mime_message,
- gboolean forward_as_attachment,
- gboolean keep_attachments)
-{
- EMsgComposer *composer;
- CamelMimePart *part;
- const char *from, *subject;
- char *fwd_subj;
-
- if (!forward_as_attachment)
- g_warning ("Forward as non-attachment not implemented.");
- if (!keep_attachments)
- g_warning ("Forwarding without attachments not implemented.");
-
- composer = E_MSG_COMPOSER (e_msg_composer_new ());
-
- part = camel_mime_part_new ();
- camel_mime_part_set_disposition (part, "inline");
- camel_mime_part_set_description (part, "forwarded message");
- camel_medium_set_content_object (CAMEL_MEDIUM (part),
- CAMEL_DATA_WRAPPER (mime_message));
- camel_mime_part_set_content_type (part, "message/rfc822");
-
- e_msg_composer_attach (composer, part);
- gtk_object_unref (GTK_OBJECT (part));
-
- 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;
-}
diff --git a/mail/mail-ops.c b/mail/mail-ops.c
index 0f92674d45..ee1da537ef 100644
--- a/mail/mail-ops.c
+++ b/mail/mail-ops.c
@@ -609,18 +609,71 @@ reply_to_all (GtkWidget *button, gpointer user_data)
reply (FOLDER_BROWSER (user_data), TRUE);
}
+static void
+attach_msg (MessageList *ml, const char *uid, gpointer data)
+{
+ EMsgComposer *composer = data;
+ CamelMimeMessage *message;
+ CamelMimePart *part;
+ const char *subject;
+ char *desc;
+
+ message = camel_folder_get_message (ml->folder, uid, NULL);
+ if (!message)
+ return;
+ subject = camel_mime_message_get_subject (message);
+ if (subject)
+ desc = g_strdup_printf ("Forwarded message - %s", subject);
+ else
+ desc = g_strdup ("Forwarded message");
+
+ part = camel_mime_part_new ();
+ camel_mime_part_set_disposition (part, "inline");
+ camel_mime_part_set_description (part, desc);
+ camel_medium_set_content_object (CAMEL_MEDIUM (part),
+ CAMEL_DATA_WRAPPER (message));
+ camel_mime_part_set_content_type (part, "message/rfc822");
+
+ e_msg_composer_attach (composer, part);
+
+ gtk_object_unref (GTK_OBJECT (part));
+ gtk_object_unref (GTK_OBJECT (message));
+ g_free (desc);
+}
+
void
forward_msg (GtkWidget *button, gpointer user_data)
{
FolderBrowser *fb;
EMsgComposer *composer;
+ CamelMimeMessage *cursor_msg;
+ const char *from, *subject;
+ char *fwd_subj;
if (!check_configured ())
return;
fb = FOLDER_BROWSER (user_data);
- composer = mail_generate_forward (fb->mail_display->current_message,
- TRUE, TRUE);
+
+ composer = E_MSG_COMPOSER (e_msg_composer_new ());
+ message_list_foreach (fb->message_list, attach_msg, composer);
+
+ cursor_msg = fb->mail_display->current_message;
+
+ from = camel_mime_message_get_from (cursor_msg);
+ subject = camel_mime_message_get_subject (cursor_msg);
+ 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);
gtk_signal_connect (GTK_OBJECT (composer), "send",
GTK_SIGNAL_FUNC (composer_send_cb), NULL);
diff --git a/mail/mail.h b/mail/mail.h
index 38412d972b..788bb579bf 100644
--- a/mail/mail.h
+++ b/mail/mail.h
@@ -42,10 +42,6 @@ void mail_format_mime_message (CamelMimeMessage *mime_message,
EMsgComposer *mail_generate_reply (CamelMimeMessage *mime_message,
gboolean to_all);
-EMsgComposer *mail_generate_forward (CamelMimeMessage *mime_message,
- gboolean forward_as_attachment,
- gboolean keep_attachments);
-
/* mail-identify */
char *mail_identify_mime_part (CamelMimePart *part);