From 76e2be74ffaf855a1c79132cb36a635c642be8b4 Mon Sep 17 00:00:00 2001 From: Veerapuram Varadhan Date: Tue, 5 Jul 2005 16:30:22 +0000 Subject: Added "forward" command-line option for mails. * Added "forward" command-line option for mails. svn path=/trunk/; revision=29639 --- mail/mail-component.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'mail/mail-component.c') diff --git a/mail/mail-component.c b/mail/mail-component.c index be881b1fa6..ac6453de28 100644 --- a/mail/mail-component.c +++ b/mail/mail-component.c @@ -821,9 +821,10 @@ handleuri_got_folder(char *uri, CamelFolder *folder, void *data) if (folder != NULL) { const char *reply = camel_url_get_param(url, "reply"); + const char *forward = camel_url_get_param(url, "forward"); + int mode; if (reply) { - int mode; if (!strcmp(reply, "all")) mode = REPLY_MODE_ALL; @@ -833,6 +834,27 @@ handleuri_got_folder(char *uri, CamelFolder *folder, void *data) mode = REPLY_MODE_SENDER; em_utils_reply_to_message(folder, camel_url_get_param(url, "uid"), NULL, mode, NULL); + } else if (forward) { + GPtrArray *uids; + const char* uid; + + uid = camel_url_get_param(url, "uid"); + if (uid == NULL) + g_warning("Could not forward the message. UID is NULL."); + else { + uids = g_ptr_array_new(); + g_ptr_array_add(uids, g_strdup(uid)); + + if (!strcmp(forward, "attached")) + em_utils_forward_attached(folder, uids, uri); + else if (!strcmp(forward, "inline")) + em_utils_forward_inline(folder, uids, uri); + else if (!strcmp(forward, "quoted")) + em_utils_forward_quoted(folder, uids, uri); + else { /* Just the default forward */ + em_utils_forward_messages(folder, uids, uri); + } + } } else { emmb = (EMMessageBrowser *)em_message_browser_window_new(); /*message_list_set_threaded(((EMFolderView *)emmb)->list, emfv->list->threaded);*/ -- cgit