[evolution-data-server] Bug #524219 (bnc) - Unable to read forward groupwise mails in other clients.



commit 2fd1a4cb7a775e2be1e821738bad0874879b1c89
Author: Chenthill Palanisamy <pchenthill novell com>
Date:   Thu Jul 23 16:10:31 2009 +0530

    Bug #524219 (bnc) - Unable to read forward groupwise mails in other clients.

 .../groupwise/camel-groupwise-transport.c          |   15 ++++--------
 camel/providers/groupwise/camel-groupwise-utils.c  |   23 +++++++++----------
 2 files changed, 16 insertions(+), 22 deletions(-)
---
diff --git a/camel/providers/groupwise/camel-groupwise-transport.c b/camel/providers/groupwise/camel-groupwise-transport.c
index fa31f7a..af7ff93 100644
--- a/camel/providers/groupwise/camel-groupwise-transport.c
+++ b/camel/providers/groupwise/camel-groupwise-transport.c
@@ -147,7 +147,7 @@ groupwise_send_to (CamelTransport *transport,
 	EGwConnectionStatus status = 0;
 	GSList *sent_item_list = NULL;
 	gchar *url = NULL;
-	const gchar *reply_request = NULL;
+	gchar *reply_request = NULL;
 	EGwItemLinkInfo *info = NULL;
 
 	if (!transport) {
@@ -184,22 +184,17 @@ groupwise_send_to (CamelTransport *transport,
 
 	item = camel_groupwise_util_item_from_message (cnc, message, from);
 
-	reply_request = (gchar *)camel_medium_get_header (CAMEL_MEDIUM (message), "X-GW-ORIG-ITEM-ID");
+	reply_request = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (message), "X-GW-ORIG-ITEM-ID"));
 	if (reply_request) {
-		gchar *id;
-		gint len = strlen (reply_request);
-
-		id = (gchar *)g_malloc0 (len-1);
-		id = memcpy(id, reply_request+2, len-3);
-		status = e_gw_connection_reply_item (cnc, id, REPLY_VIEW, &temp_item);
+		g_strstrip (reply_request);
+		status = e_gw_connection_reply_item (cnc, reply_request, REPLY_VIEW, &temp_item);
 		if (status != E_GW_CONNECTION_STATUS_OK)
 			g_warning ("Could not send a replyRequest...continuing without!!\n");
 		else {
 			info = e_gw_item_get_link_info (temp_item);
 			e_gw_item_set_link_info (item, info);
 		}
-
-		g_free (id);
+		g_free (reply_request);
 	}
 
 	/*Send item*/
diff --git a/camel/providers/groupwise/camel-groupwise-utils.c b/camel/providers/groupwise/camel-groupwise-utils.c
index 2dc6acd..e0678f5 100644
--- a/camel/providers/groupwise/camel-groupwise-utils.c
+++ b/camel/providers/groupwise/camel-groupwise-utils.c
@@ -341,28 +341,27 @@ send_as_attachment (EGwConnection *cnc, EGwItem *item, CamelStreamMem *content,
 
 	attachment->name = g_strdup (filename ? filename : "");
 	if (camel_content_type_is (type, "message", "rfc822")) {
-		const gchar *item_id;
-		gchar *msgid;
-		gint len;
+		gchar *item_id;
 
-		item_id = camel_medium_get_header (CAMEL_MEDIUM (dw), "X-GW-ITEM-ID");
+		item_id = g_strdup (camel_medium_get_header (CAMEL_MEDIUM (dw), "X-GW-ITEM-ID"));
 		/*
 		 * XXX: The following code piece is a screwed up way of doing stuff.
 		 * But we dont have much choice. Do not use 'camel_header_msgid_decode'
 		 * since it removes the container id portion from the id and which the
 		 * groupwise server needs.
 		 */
-
-		len = strlen (item_id);
-		msgid = (gchar *)g_malloc0 (len-1);
-		msgid = memcpy(msgid, item_id+2, len-3);
-		g_print ("||| msgid:%s\n", msgid);
-
-		status = e_gw_connection_forward_item (cnc, msgid, NULL, TRUE, &temp_item);
-		g_free (msgid);
+		g_strstrip (item_id);
+		status = e_gw_connection_forward_item (cnc, item_id, NULL, TRUE, &temp_item);
+		g_free (item_id);
 
 		if (status != E_GW_CONNECTION_STATUS_OK) {
 			g_warning ("Could not send a forwardRequest...continuing without!!\n");
+			
+			g_free (attachment->name);
+			attachment->name = g_strdup ("Mime.822");
+			
+			g_free (attachment->contentType);
+			attachment->contentType = g_strdup ("Mail");
 		} else {
 			GSList *attach_list = e_gw_item_get_attach_id_list (temp_item);
 			EGwItemAttachment *temp_attach = (EGwItemAttachment *)attach_list->data;



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