[evolution-patches] "Forward" option in the command-line



Hi,

Attached patch adds the ability to "forward" a mail from command-line
like "reply".

The new parameter takes the following values:
"quoted"
"inline"
"attached"

The command-line syntax is:
evolution
'email://1118659289 31725 12 vvaradhan-test/Calendar;uid=424;forward=quoted'

The default value is "attached".

Kindly let me know your comments/suggestions.

Thanks,

V. Varadhan
Index: mail/mail-component.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-component.c,v
retrieving revision 1.120
diff -u -p -r1.120 mail-component.c
--- mail/mail-component.c	23 Jun 2005 09:11:06 -0000	1.120
+++ mail/mail-component.c	24 Jun 2005 16:53:00 -0000
@@ -821,9 +821,10 @@ handleuri_got_folder(char *uri, CamelFol
 
 	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,32 @@ handleuri_got_folder(char *uri, CamelFol
 				mode = REPLY_MODE_SENDER;
 
 			em_utils_reply_to_message(folder, camel_url_get_param(url, "uid"), NULL, mode, NULL);
+		} else if (forward) {
+
+			GConfClient *gconf;
+			GError* error;
+			CamelMimeMessage* msg;
+
+			if (!strcmp (forward, "attached"))
+				mode = MAIL_CONFIG_FORWARD_ATTACHED;
+			else if (!strcmp (forward, "inline"))
+				mode = MAIL_CONFIG_FORWARD_INLINE;
+			else if (!strcmp (forward, "quoted"))
+				mode = MAIL_CONFIG_FORWARD_QUOTED;
+			else /* Just the default forward */
+				mode = MAIL_CONFIG_FORWARD_ATTACHED;
+			
+			gconf = mail_config_get_gconf_client ();
+			gconf_client_set_int (gconf, "/apps/evolution/mail/format/forward_style", mode, &error);
+			
+			/* FIXME - Error handling */
+			/* if (error != NULL) */
+			   /* Handle the gconf-error appropriately*/
+			
+			msg = camel_folder_get_message (folder, camel_url_get_param (url, "uid"), NULL);
+
+			em_utils_forward_message (msg, uri); 
+			g_object_unref (msg);
 		} else {
 			emmb = (EMMessageBrowser *)em_message_browser_window_new();
 			/*message_list_set_threaded(((EMFolderView *)emmb)->list, emfv->list->threaded);*/
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3647
diff -u -p -r1.3647 ChangeLog
--- mail/ChangeLog	21 Jun 2005 05:33:47 -0000	1.3647
+++ mail/ChangeLog	24 Jun 2005 16:53:39 -0000
@@ -1,3 +1,8 @@
+2005-06-24 Veerapuram Varadhan <vvaradhan novell com>
+
+	* mail-component.c: (handleuri_got_folder): Added "forward"
+	command-line option.
+	
 2005-06-21 Brian Mury <b mury ieee org>
 
 	** See bug #301466.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]