[evolution-patches] Updated Patch for 72285
- From: Sankar P <psankar novell com>
- To: evolution-patches lists ximian com
- Cc: Not Zed <notzed ximian com>
- Subject: [evolution-patches] Updated Patch for 72285
- Date: Thu, 24 Feb 2005 12:17:43 +0530
Hi,
Attached with this mail is the patch for 72285.
Instead of adding headers for every address, a list is generated and a
single header is added at last, cumulatively.
Thanks & Regards,
Sankar P
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/ChangeLog,v
retrieving revision 1.23
diff -u -p -r1.23 ChangeLog
--- ChangeLog 22 Feb 2005 05:06:58 -0000 1.23
+++ ChangeLog 24 Feb 2005 06:37:58 -0000
@@ -1,3 +1,9 @@
+2005-02-23 Sankar P <psankar novell com>
+
+ * camel-groupwise-folder.c: (groupwise_folder_get_message):
+ Changed handling of addresses by using _camel_header_address
+ to enable display of gwpoa generated messages.
+
2005-02-22 Chenthill Palanisamy <pchenthill novell com>
* camel-groupwise-folder.c: (convert_to_calendar): Append
Index: camel-groupwise-folder.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/groupwise/camel-groupwise-folder.c,v
retrieving revision 1.27
diff -u -p -r1.27 camel-groupwise-folder.c
--- camel-groupwise-folder.c 22 Feb 2005 05:06:58 -0000 1.27
+++ camel-groupwise-folder.c 24 Feb 2005 06:38:00 -0000
@@ -87,7 +87,6 @@ groupwise_folder_get_message( CamelFolde
CamelGroupwiseStorePrivate *priv = gw_store->priv;
CamelGroupwiseMessageInfo *mi = NULL ;
char *temp_name, *folder_name, *container_id, *body , *temp_str = NULL ;
- CamelInternetAddress *from_addr, *to_addr, *cc_addr, *bcc_addr ;
GSList *recipient_list, *attach_list ;
EGwItemOrganizer *org ;
EGwItemType type ;
@@ -100,6 +99,9 @@ groupwise_folder_get_message( CamelFolde
int errno;
GList *read_items = NULL ;
guint32 item_status ;
+ struct _camel_header_address *ha;
+ char *subs_email;
+ struct _camel_header_address *to_list = NULL, *cc_list = NULL, *bcc_list=NULL;
/* see if it is there in cache */
CAMEL_SERVICE_LOCK (folder->parent_store, connect_lock);
@@ -191,12 +193,6 @@ groupwise_folder_get_message( CamelFolde
org = e_gw_item_get_organizer (item) ;
recipient_list = e_gw_item_get_recipient_list (item) ;
- /*Addresses*/
- from_addr = camel_internet_address_new () ;
- to_addr = camel_internet_address_new () ;
- cc_addr = camel_internet_address_new () ;
- bcc_addr = camel_internet_address_new () ;
-
if (recipient_list) {
GSList *rl ;
char *status_opt = NULL;
@@ -206,21 +202,25 @@ groupwise_folder_get_message( CamelFolde
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
enabled = recp->status_enabled ;
+ if (!recp->email) {
+ ha=camel_header_address_new_group(recp->display_name);
+ } else {
+ ha=camel_header_address_new_name(recp->display_name,recp->email);
+ }
+
if (recp->type == E_GW_ITEM_RECIPIENT_TO) {
if (recp->status_enabled)
status_opt = g_strconcat (status_opt ? status_opt : "" , "TO", ";",NULL) ;
- camel_internet_address_add (to_addr, recp->display_name, recp->email ) ;
-
+ camel_header_address_list_append(&to_list, ha);
} else if (recp->type == E_GW_ITEM_RECIPIENT_CC) {
if (recp->status_enabled)
status_opt = g_strconcat (status_opt ? status_opt : "", "CC", ";",NULL) ;
- camel_internet_address_add (cc_addr, recp->display_name, recp->email ) ;
+ camel_header_address_list_append(&cc_list,ha);
} else if (recp->type == E_GW_ITEM_RECIPIENT_BC) {
if (recp->status_enabled)
status_opt = g_strconcat (status_opt ? status_opt : "", "BCC", ";",NULL) ;
- camel_internet_address_add (bcc_addr, recp->display_name, recp->email ) ;
-
+ camel_header_address_list_append(&bcc_list,ha);
}
if (recp->status_enabled) {
status_opt = g_strconcat (status_opt,
@@ -241,14 +241,40 @@ groupwise_folder_get_message( CamelFolde
camel_medium_add_header ( CAMEL_MEDIUM (msg), "X-gw-status-opt", (const char *)status_opt) ;
g_free (status_opt) ;
}
-
- camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_TO, to_addr) ;
- camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_CC, cc_addr) ;
- camel_mime_message_set_recipients (msg, CAMEL_RECIPIENT_TYPE_BCC, bcc_addr) ;
}
- if (org)
- camel_internet_address_add (from_addr,org->display_name,org->email) ;
-
+
+ if(to_list) {
+ subs_email=camel_header_address_list_encode(to_list);
+ camel_medium_set_header( CAMEL_MEDIUM(msg), "To", subs_email);
+ g_free(subs_email);
+ camel_header_address_list_clear(&to_list);
+ }
+
+ if(cc_list) {
+ subs_email=camel_header_address_list_encode(cc_list);
+ camel_medium_set_header( CAMEL_MEDIUM(msg), "Cc", subs_email);
+ g_free(subs_email);
+ camel_header_address_list_clear(&cc_list);
+ }
+
+ if(bcc_list) {
+ subs_email=camel_header_address_list_encode(bcc_list);
+ camel_medium_set_header( CAMEL_MEDIUM(msg), "Bcc", subs_email);
+ g_free(subs_email);
+ camel_header_address_list_clear(&bcc_list);
+ }
+
+ if (org) {
+ if (org->display_name && org->email) {
+ ha=camel_header_address_new_name(org->display_name,org->email);
+ } else {
+ ha=camel_header_address_new_group(org->display_name);
+ }
+ subs_email=camel_header_address_list_encode(ha);
+ camel_medium_set_header( CAMEL_MEDIUM(msg), "From", subs_email);
+ camel_header_address_unref(ha);
+ g_free(subs_email);
+ }
if (e_gw_item_get_reply_request (item)) {
char *reply_within;
const char *mess = e_gw_item_get_message (item);
@@ -319,7 +345,6 @@ groupwise_folder_get_message( CamelFolde
time_t actual_time = mktime (tm) ;
camel_mime_message_set_date (msg, actual_time, 0) ;
}
- camel_mime_message_set_from (msg, from_addr) ;
/* Attachments
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]