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



On Tue, 2005-07-05 at 13:17 +0800, Not Zed wrote:
> The 'default' should just use the 'default' (i.e. what was being used
> before), but you're overriding it to always use forward attached.
Ah!! A very good point. Thanks.

> Looks good except for the default forward style.  Oh, and this is
> external data - you really dont want to 'assert' on external data,
> asserts are only used to assert internal conditions are met.
> 
> e.g. it should be a normal thing like:
> 
> if (uid == NULL)
>   g_warning(...)
> else {
> }
Hmm. Thanks.

Hope the attached one will make it to cvs. ;)

Let me know of any further suggestions/comments.

Thanks again,

V. Varadhan
Index: mail/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3649
diff -u -p -r1.3649 ChangeLog
--- mail/ChangeLog	1 Jul 2005 03:29:22 -0000	1.3649
+++ mail/ChangeLog	5 Jul 2005 09:17:04 -0000
@@ -1,3 +1,8 @@
+2005-07-04  Veerapuram Varadhan <vvaradhan novell com>
+
+	* mail-component.c: (handleuri_got_folder): Added "forward"
+	command-line option.
+	
 2005-06-24	Matt Brown	<matt mattb net nz>
 
 	* em-inline-filter.c: implement extraction of inline signed/encrypted pgp
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	5 Jul 2005 09:18:45 -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,29 @@ 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) {
+			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 */
+					CamelMimeMessage* msg = camel_folder_get_message(folder, uid, NULL);
+					em_utils_forward_message(msg, uri);
+					camel_object_unref(msg);
+				}
+			}
 		} else {
 			emmb = (EMMessageBrowser *)em_message_browser_window_new();
 			/*message_list_set_threaded(((EMFolderView *)emmb)->list, emfv->list->threaded);*/


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