[evolution-patches] Updated patch for bugzilla bug 72285
- From: Sankar P <psankar novell com>
- To: evolution-patches lists ximian com
- Subject: [evolution-patches] Updated patch for bugzilla bug 72285
- Date: Wed, 23 Feb 2005 15:42:13 +0530
Hi,
Attached with this mail is the updated patch for bugzilla bug 72285.
Instead of setting a null address field, _camel_header_address structure
is used to enable display of gwpoa generated messages.
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 23 Feb 2005 10:00:47 -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 23 Feb 2005 10:00:50 -0000
@@ -65,11 +65,11 @@ struct _CamelGroupwiseFolderPrivate {
/*prototypes*/
static void groupwise_transfer_messages_to (CamelFolder *source,
- GPtrArray *uids,
- CamelFolder *destination,
- GPtrArray **transferred_uids,
- gboolean delete_originals,
- CamelException *ex);
+ GPtrArray *uids,
+ CamelFolder *destination,
+ GPtrArray **transferred_uids,
+ gboolean delete_originals,
+ CamelException *ex);
static int gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) ;
void convert_to_calendar (EGwItem *item, char **str, int *len) ;
@@ -78,8 +78,8 @@ void convert_to_calendar (EGwItem *item,
static CamelMimeMessage *
groupwise_folder_get_message( CamelFolder *folder,
- const char *uid,
- CamelException *ex )
+ const char *uid,
+ CamelException *ex )
{
CamelMimeMessage *msg = NULL ;
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder) ;
@@ -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 ;
@@ -99,14 +98,19 @@ groupwise_folder_get_message( CamelFolde
CamelMultipart *multipart ;
int errno;
GList *read_items = NULL ;
- guint32 item_status ;
+ guint32 item_status;
/* see if it is there in cache */
+
+ struct _camel_header_address *ha;
+ char *subs_email;
+
+
CAMEL_SERVICE_LOCK (folder->parent_store, connect_lock);
mi = (CamelGroupwiseMessageInfo *) camel_folder_summary_uid (folder->summary, uid);
if (mi == NULL) {
camel_exception_setv(ex, CAMEL_EXCEPTION_FOLDER_INVALID_UID,
- _("Cannot get message: %s\n %s"), uid, _("No such message"));
+ _("Cannot get message: %s\n %s"), uid, _("No such message"));
CAMEL_SERVICE_UNLOCK (folder->parent_store, connect_lock);
return NULL;
}
@@ -127,30 +131,30 @@ groupwise_folder_get_message( CamelFolde
return NULL;
} else {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot get message %s: %s"),
- uid, g_strerror (errno));
+ uid, g_strerror (errno));
camel_object_unref (msg);
msg = NULL;
}
}
-
-
+
+
camel_object_unref (stream);
camel_object_unref (cache_stream);
-
+
}
CAMEL_GROUPWISE_FOLDER_UNLOCK (folder, cache_lock);
if (msg != NULL) {
CAMEL_SERVICE_UNLOCK (folder->parent_store, connect_lock);
return msg;
}
-
+
if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_UNAVAILABLE,
- _("This message is not available in offline mode."));
+ _("This message is not available in offline mode."));
CAMEL_SERVICE_UNLOCK (folder->parent_store, connect_lock);
return NULL;
}
-
+
folder_name = g_strdup(folder->name) ;
temp_name = strrchr (folder_name,'/') ;
if(temp_name == NULL) {
@@ -161,7 +165,7 @@ groupwise_folder_get_message( CamelFolde
container_id = g_strdup (camel_groupwise_store_container_id_lookup (gw_store, temp_name)) ;
}
-
+
/*Create and populate the MIME Message structure*/
msg = camel_mime_message_new () ;
@@ -178,30 +182,24 @@ groupwise_folder_get_message( CamelFolde
CAMEL_SERVICE_UNLOCK (folder->parent_store, connect_lock);
return NULL;
}
-
+
type = e_gw_item_get_item_type(item) ;
if (type == E_GW_ITEM_TYPE_UNKNOWN) {
/*XXX: Free memory allocations*/
- return NULL ;
+ return NULL ;
} else if (type == E_GW_ITEM_TYPE_NOTIFICATION) {
camel_medium_add_header ( CAMEL_MEDIUM (msg), "X-Notification", "shared-folder") ;
} else if (type == E_GW_ITEM_TYPE_MAIL) {
- }
-
+ }
+
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;
gboolean enabled ;
-
+
for (rl = recipient_list ; rl != NULL ; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
enabled = recp->status_enabled ;
@@ -209,46 +207,94 @@ groupwise_folder_get_message( CamelFolde
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 ) ;
-
+ if (!recp->email)
+ {
+ ha=camel_header_address_new_group(recp->display_name);
+ }
+ else
+ {
+ ha=camel_header_address_new_name(recp->display_name,recp->email);
+ }
+
+ subs_email=camel_header_address_list_encode(ha);
+ camel_medium_add_header( CAMEL_MEDIUM(msg), "To", subs_email);
+ camel_header_address_unref(ha);
+ ha=NULL;
+ g_free(subs_email);
+
} 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 ) ;
-
+ if (!recp->email)
+ {
+ ha=camel_header_address_new_group(recp->display_name);
+ }
+ else
+ {
+ ha=camel_header_address_new_name(recp->display_name,recp->email);
+ }
+ subs_email=camel_header_address_list_encode(ha);
+ camel_medium_add_header( CAMEL_MEDIUM(msg), "Cc", subs_email);
+ camel_header_address_unref(ha);
+ ha=NULL;
+ g_free(subs_email);
+
} 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 ) ;
+ if (!recp->email)
+ {
+ ha=camel_header_address_new_group(recp->display_name);
+ }
+ else
+ {
+ ha=camel_header_address_new_name(recp->display_name,recp->email);
+ }
+ subs_email=camel_header_address_list_encode(ha);
+ camel_medium_add_header( CAMEL_MEDIUM(msg), "Bcc", subs_email);
+ camel_header_address_unref(ha);
+ ha=NULL;
+ g_free(subs_email);
}
if (recp->status_enabled) {
status_opt = g_strconcat (status_opt,
- recp->display_name,";",
- recp->email,";",
- recp->delivered_date ? recp->delivered_date : "", ";",
- recp->opened_date ? recp->opened_date : "", ";",
- recp->accepted_date ? recp->accepted_date : "", ";",
- recp->deleted_date ? recp->deleted_date : "", ";",
- recp->declined_date ? recp->declined_date : "", ";",
- recp->completed_date ? recp->completed_date : "", ";",
- recp->undelivered_date ? recp->undelivered_date : "", ";",
- "::", NULL) ;
-
+ recp->display_name,";",
+ recp->email,";",
+ recp->delivered_date ? recp->delivered_date : "", ";",
+ recp->opened_date ? recp->opened_date : "", ";",
+ recp->accepted_date ? recp->accepted_date : "", ";",
+ recp->deleted_date ? recp->deleted_date : "", ";",
+ recp->declined_date ? recp->declined_date : "", ";",
+ recp->completed_date ? recp->completed_date : "", ";",
+ recp->undelivered_date ? recp->undelivered_date : "", ";",
+ "::", NULL) ;
}
}
if (enabled) {
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 (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);
+ ha=NULL;
+ g_free(subs_email);
+ }
+
+
if (e_gw_item_get_reply_request (item)) {
char *reply_within;
const char *mess = e_gw_item_get_message (item);
@@ -272,7 +318,7 @@ groupwise_folder_get_message( CamelFolde
g_free (value);
}
}
-
+
/*Content and content-type*/
body = g_strdup(e_gw_item_get_message(item));
if (body) {
@@ -308,7 +354,7 @@ groupwise_folder_get_message( CamelFolde
camel_multipart_add_part (multipart, part) ;
camel_object_unref (part) ;
}
-
+
temp_str = (char *)e_gw_item_get_subject(item) ;
if(temp_str)
camel_mime_message_set_subject (msg, temp_str) ;
@@ -319,8 +365,7 @@ 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
* XXX:Free attach list
@@ -336,8 +381,8 @@ groupwise_folder_get_message( CamelFolde
CamelMimePart *part ;
status = e_gw_connection_get_attachment (cnc,
- g_strdup(attach->id), 0, -1,
- (const char **)&attachment, &len) ;
+ g_strdup(attach->id), 0, -1,
+ (const char **)&attachment, &len) ;
if (status != E_GW_CONNECTION_STATUS_OK) {
//camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Could not get attachment"));
g_warning ("Could not get attachment\n") ;
@@ -358,13 +403,13 @@ groupwise_folder_get_message( CamelFolde
}
g_free (attachment) ;
}
-
+
}
camel_medium_set_content_object(CAMEL_MEDIUM (msg), CAMEL_DATA_WRAPPER(multipart));
camel_object_unref (multipart) ;
-
+
item_status = e_gw_item_get_item_status (item);
if ( !(item_status & E_GW_ITEM_STAT_READ)) {
read_items = g_list_append (read_items, (char *)uid) ;
@@ -372,7 +417,7 @@ groupwise_folder_get_message( CamelFolde
}
g_object_unref (item) ;
-
+
if (body)
g_free (body) ;
/* add to cache */
@@ -394,7 +439,7 @@ groupwise_folder_get_message( CamelFolde
}
-static void
+ static void
groupwise_folder_rename (CamelFolder *folder, const char *new)
{
CamelGroupwiseFolder *gw_folder = (CamelGroupwiseFolder *)folder ;
@@ -425,21 +470,21 @@ groupwise_folder_rename (CamelFolder *fo
g_free (folder_dir) ;
}
-static GPtrArray *
+ static GPtrArray *
groupwise_folder_search_by_expression (CamelFolder *folder, const char *expression, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder) ;
GPtrArray *matches ;
-
+
CAMEL_GROUPWISE_FOLDER_LOCK(folder, search_lock);
camel_folder_search_set_folder (gw_folder->search, folder);
matches = camel_folder_search_search(gw_folder->search, expression, NULL, ex);
CAMEL_GROUPWISE_FOLDER_UNLOCK(gw_folder, search_lock);
-
+
return matches ;
}
-static GPtrArray *
+ static GPtrArray *
groupwise_folder_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids, CamelException *ex)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder) ;
@@ -447,7 +492,7 @@ groupwise_folder_search_by_uids(CamelFol
if (uids->len == 0)
return g_ptr_array_new() ;
-
+
CAMEL_GROUPWISE_FOLDER_LOCK(folder, search_lock);
camel_folder_search_set_folder(gw_folder->search, folder);
@@ -458,11 +503,11 @@ groupwise_folder_search_by_uids(CamelFol
return matches ;
}
-static void
+ static void
groupwise_folder_search_free (CamelFolder *folder, GPtrArray *uids)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER(folder) ;
-
+
g_return_if_fail (gw_folder->search);
CAMEL_GROUPWISE_FOLDER_LOCK(folder, search_lock);
@@ -470,11 +515,11 @@ groupwise_folder_search_free (CamelFolde
camel_folder_search_free_result (gw_folder->search, uids);
CAMEL_GROUPWISE_FOLDER_UNLOCK(gw_folder, search_lock);
-
+
}
-static void
+ static void
groupwise_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
{
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store) ;
@@ -490,9 +535,9 @@ groupwise_sync (CamelFolder *folder, gbo
if (((CamelOfflineStore *) gw_store)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL)
return ;
-
+
container_id = camel_groupwise_store_container_id_lookup (gw_store, folder->name) ;
-
+
CAMEL_SERVICE_LOCK (folder->parent_store, connect_lock);
count = camel_folder_summary_count (folder->summary) ;
@@ -518,15 +563,15 @@ groupwise_sync (CamelFolder *folder, gbo
}
}
}
-
+
}
-/* if (items)
+ /* if (items)
e_gw_connection_mark_read (cnc, items) ;*/
if (expunge)
e_gw_connection_purge_deleted_items (cnc) ;
-
+
camel_folder_summary_save (folder->summary);
CAMEL_SERVICE_UNLOCK (folder->parent_store, connect_lock);
@@ -534,7 +579,7 @@ groupwise_sync (CamelFolder *folder, gbo
-CamelFolder *
+ CamelFolder *
camel_gw_folder_new(CamelStore *store, const char *folder_name, const char *folder_dir, CamelException *ex)
{
CamelFolder *folder ;
@@ -560,8 +605,8 @@ camel_gw_folder_new(CamelStore *store, c
if (!folder->summary) {
camel_object_unref (CAMEL_OBJECT (folder));
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
- _("Could not load summary for %s"),
- folder_name);
+ _("Could not load summary for %s"),
+ folder_name);
return NULL;
}
@@ -589,12 +634,12 @@ camel_gw_folder_new(CamelStore *store, c
camel_object_unref (folder) ;
return NULL ;
}
-
+
return folder ;
}
-static void
+ static void
groupwise_refresh_info(CamelFolder *folder, CamelException *ex)
{
CamelGroupwiseStore *gw_store = CAMEL_GROUPWISE_STORE (folder->parent_store) ;
@@ -621,7 +666,7 @@ groupwise_refresh_info(CamelFolder *fold
g_free (container_id) ;
return ;
}
-
+
if (camel_folder_is_frozen (folder) ) {
gw_folder->need_refresh = TRUE ;
}
@@ -633,27 +678,27 @@ groupwise_refresh_info(CamelFolder *fold
tm = gmtime (&mod_time) ;
strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm) ;
-
+
CAMEL_SERVICE_LOCK (gw_store, connect_lock);
status = e_gw_connection_get_quick_messages (cnc, container_id,
- "distribution created attachments subject",
- time_string, "New", "Mail", NULL, -1, &slist) ;
+ "distribution created attachments subject",
+ time_string, "New", "Mail", NULL, -1, &slist) ;
if (status != E_GW_CONNECTION_STATUS_OK) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
CAMEL_SERVICE_UNLOCK (gw_store, connect_lock);
g_free (container_id) ;
return ;
}
-
+
for ( sl = slist ; sl != NULL; sl = sl->next) {
list = g_list_append (list, sl->data) ;
}
g_slist_free (slist);
slist = NULL;
status = e_gw_connection_get_quick_messages (cnc, container_id,
- "distribution created attachments subject",
- time_string, "Modified", "Mail", NULL, -1, &slist) ;
+ "distribution created attachments subject",
+ time_string, "Modified", "Mail", NULL, -1, &slist) ;
if (status != E_GW_CONNECTION_STATUS_OK) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed"));
CAMEL_SERVICE_UNLOCK (gw_store, connect_lock);
@@ -682,7 +727,7 @@ groupwise_refresh_info(CamelFolder *fold
-void
+ void
gw_update_summary ( CamelFolder *folder, GList *item_list,CamelException *ex)
{
CamelGroupwiseMessageInfo *mi = NULL;
@@ -691,8 +736,8 @@ gw_update_summary ( CamelFolder *folder,
guint32 item_status, status_flags;
CamelFolderChangeInfo *changes = NULL ;
int scount, got = g_list_length (item_list) ;
-
-// CAMEL_SERVICE_ASSERT_LOCKED (gw_store, connect_lock);
+
+ // CAMEL_SERVICE_ASSERT_LOCKED (gw_store, connect_lock);
scount = camel_folder_summary_count (folder->summary) ;
@@ -713,7 +758,7 @@ gw_update_summary ( CamelFolder *folder,
/*Message exists*/
item_status = e_gw_item_get_item_status (item);
/*if (item_status & E_GW_ITEM_STAT_DELETED)
- status_flags |= CAMEL_MESSAGE_DELETED;*/
+ status_flags |= CAMEL_MESSAGE_DELETED;*/
if (item_status & E_GW_ITEM_STAT_REPLIED)
status_flags |= CAMEL_MESSAGE_ANSWERED;
mi->info.flags |= status_flags;
@@ -740,7 +785,7 @@ gw_update_summary ( CamelFolder *folder,
if (item_status & E_GW_ITEM_STAT_READ)
status_flags |= CAMEL_MESSAGE_SEEN;
/*if (item_status & E_GW_ITEM_STAT_DELETED)
- status_flags |= CAMEL_MESSAGE_DELETED;*/
+ status_flags |= CAMEL_MESSAGE_DELETED;*/
if (item_status & E_GW_ITEM_STAT_REPLIED)
status_flags |= CAMEL_MESSAGE_ANSWERED;
mi->info.flags |= status_flags;
@@ -767,14 +812,14 @@ gw_update_summary ( CamelFolder *folder,
g_ptr_array_add (msg, mi) ;
g_free(date) ;
}
-
+
}
camel_object_trigger_event (folder, "folder_changed", changes) ;
/* for (seq=0 ; seq<msg->len ; seq++) {
if ( (mi = msg->pdata[seq]) )
- //camel_folder_summary_info_free(folder->summary, mi);
- camel_folder_info_free(mi);
- } */
+ //camel_folder_summary_info_free(folder->summary, mi);
+ camel_folder_info_free(mi);
+ } */
camel_folder_change_info_free (changes) ;
g_ptr_array_free (msg, TRUE) ;
}
@@ -793,7 +838,7 @@ groupwise_append_message (CamelFolder *f
EGwConnection *cnc = cnc_lookup (priv) ;
EGwItem *item;
char *id;
-
+
if (offline->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) {
camel_groupwise_journal_append ((CamelGroupwiseJournal *) ((CamelGroupwiseFolder *)folder)->journal, message, info, appended_uid, ex);
return;
@@ -810,20 +855,20 @@ groupwise_append_message (CamelFolder *f
item = camel_groupwise_util_item_from_message (message, CAMEL_ADDRESS (message->from), recipients);
/*Set the source*/
if (!strcmp (folder->name, RECEIVED))
- e_gw_item_set_source (item, "received") ;
+ e_gw_item_set_source (item, "received") ;
if (!strcmp (folder->name, SENT))
- e_gw_item_set_source (item, "sent") ;
+ e_gw_item_set_source (item, "sent") ;
if (!strcmp (folder->name, DRAFT))
- e_gw_item_set_source (item, "draft") ;
+ e_gw_item_set_source (item, "draft") ;
if (!strcmp (folder->name, PERSONAL))
- e_gw_item_set_source (item, "personal") ;
+ e_gw_item_set_source (item, "personal") ;
/*set container id*/
e_gw_item_set_container_id (item, container_id) ;
status = e_gw_connection_create_item (cnc, item, &id);
if (status != E_GW_CONNECTION_STATUS_OK) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot create message: %s"),
- e_gw_connection_get_error_message (status));
+ e_gw_connection_get_error_message (status));
if (appended_uid)
*appended_uid = NULL;
@@ -835,7 +880,7 @@ groupwise_append_message (CamelFolder *f
g_message ("Adding %s to %s", id, container_id);
if (status != E_GW_CONNECTION_STATUS_OK) {
camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM, _("Cannot append message to folder `%s': %s"),
- folder->full_name, e_gw_connection_get_error_message (status));
+ folder->full_name, e_gw_connection_get_error_message (status));
if (appended_uid)
*appended_uid = NULL;
@@ -850,7 +895,7 @@ groupwise_append_message (CamelFolder *f
CAMEL_SERVICE_UNLOCK (folder->parent_store, connect_lock) ;
}
-static int
+ static int
uid_compar (const void *va, const void *vb)
{
const char **sa = (const char **)va, **sb = (const char **)vb;
@@ -870,8 +915,8 @@ uid_compar (const void *va, const void *
static void
groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids,
- CamelFolder *destination, GPtrArray **transferred_uids,
- gboolean delete_originals, CamelException *ex)
+ CamelFolder *destination, GPtrArray **transferred_uids,
+ gboolean delete_originals, CamelException *ex)
{
int count, index = 0 ;
GList *item_ids = NULL ;
@@ -881,9 +926,9 @@ groupwise_transfer_messages_to (CamelFol
CamelGroupwiseStorePrivate *priv = gw_store->priv;
EGwConnectionStatus status ;
EGwConnection *cnc = cnc_lookup (priv) ;
-
- count = camel_folder_summary_count (destination->summary) ;
- qsort (uids->pdata, uids->len, sizeof (void *), uid_compar) ;
+
+ count = camel_folder_summary_count (destination->summary) ;
+ qsort (uids->pdata, uids->len, sizeof (void *), uid_compar) ;
while (index < uids->len) {
item_ids = g_list_append (item_ids, g_ptr_array_index (uids, index));
@@ -906,35 +951,35 @@ groupwise_transfer_messages_to (CamelFol
CamelMimeMessage *message;
GList *l;
int i;
-
+
for (l = item_ids, i = 0; l; l = l->next, i++) {
CamelMessageInfo *info;
if (!(info = camel_folder_summary_uid (source->summary, uids->pdata[i])))
continue;
-
+
if (!(message = groupwise_folder_get_message (source, camel_message_info_uid (info), ex)))
break;
-
+
camel_groupwise_journal_transfer (journal, (CamelGroupwiseFolder *)source, message, info, uids->pdata[i], NULL, ex);
camel_object_unref (message);
-
+
if (camel_exception_is_set (ex))
break;
-
+
if (delete_originals)
camel_folder_set_message_flags (source, camel_message_info_uid (info),
- CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED);
+ CAMEL_MESSAGE_DELETED, CAMEL_MESSAGE_DELETED);
}
CAMEL_SERVICE_UNLOCK (source->parent_store, connect_lock);
return;
}
-
+
index = 0 ;
while (index < uids->len) {
status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index],
- dest_container_id, source_container_id) ;
+ dest_container_id, source_container_id) ;
if (status != E_GW_CONNECTION_STATUS_OK) {
g_print ("Warning!! Could not move item : %s\n", (char *)uids->pdata[index]) ;
}
@@ -945,11 +990,11 @@ groupwise_transfer_messages_to (CamelFol
index ++;
}
camel_folder_summary_touch (source->summary) ;
-
+
CAMEL_SERVICE_UNLOCK (source->parent_store, connect_lock);
}
-static void
+ static void
groupwise_expunge (CamelFolder *folder, CamelException *ex)
{
CamelGroupwiseStore *groupwise_store = CAMEL_GROUPWISE_STORE(folder->parent_store) ;
@@ -962,13 +1007,13 @@ groupwise_expunge (CamelFolder *folder,
CamelFolderChangeInfo *changes ;
int i, max;
gboolean delete = FALSE ;
-
+
CAMEL_SERVICE_LOCK (groupwise_store, connect_lock);
-
+
changes = camel_folder_change_info_new () ;
cnc = cnc_lookup (priv) ;
-
+
container_id = g_strdup (camel_groupwise_store_container_id_lookup (groupwise_store, folder->name)) ;
max = camel_folder_summary_count (folder->summary);
@@ -988,21 +1033,21 @@ groupwise_expunge (CamelFolder *folder,
if (delete)
camel_object_trigger_event (CAMEL_OBJECT (folder), "folder_changed", changes) ;
-
+
CAMEL_SERVICE_UNLOCK (groupwise_store, connect_lock);
-
+
g_free (container_id) ;
camel_folder_change_info_free (changes) ;
}
-static void
+ static void
camel_groupwise_folder_class_init (CamelGroupwiseFolderClass *camel_groupwise_folder_class)
{
CamelFolderClass *camel_folder_class = CAMEL_FOLDER_CLASS (camel_groupwise_folder_class);
-
+
parent_class = CAMEL_OFFLINE_FOLDER_CLASS (camel_type_get_global_classfuncs (camel_offline_folder_get_type ())) ;
-
+
((CamelObjectClass *) camel_groupwise_folder_class)->getv = gw_getv;
camel_folder_class->get_message = groupwise_folder_get_message ;
@@ -1017,7 +1062,7 @@ camel_groupwise_folder_class_init (Camel
camel_folder_class->transfer_messages_to = groupwise_transfer_messages_to;
}
-static void
+ static void
camel_groupwise_folder_init (gpointer object, gpointer klass)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER (object);
@@ -1034,10 +1079,10 @@ camel_groupwise_folder_init (gpointer ob
gw_folder->priv->cache_lock = e_mutex_new(E_MUTEX_REC);
gw_folder->need_rescan = TRUE;
-
+
}
-static void
+ static void
camel_groupwise_folder_finalize (CamelObject *object)
{
CamelGroupwiseFolder *gw_folder = CAMEL_GROUPWISE_FOLDER (object);
@@ -1050,35 +1095,35 @@ camel_groupwise_folder_finalize (CamelOb
}
-CamelType
+ CamelType
camel_groupwise_folder_get_type (void)
{
static CamelType camel_groupwise_folder_type = CAMEL_INVALID_TYPE;
-
-
+
+
if (camel_groupwise_folder_type == CAMEL_INVALID_TYPE) {
camel_groupwise_folder_type =
camel_type_register (camel_offline_folder_get_type (),
- "CamelGroupwiseFolder",
- sizeof (CamelGroupwiseFolder),
- sizeof (CamelGroupwiseFolderClass),
- (CamelObjectClassInitFunc) camel_groupwise_folder_class_init,
- NULL,
- (CamelObjectInitFunc) camel_groupwise_folder_init,
- (CamelObjectFinalizeFunc) camel_groupwise_folder_finalize);
+ "CamelGroupwiseFolder",
+ sizeof (CamelGroupwiseFolder),
+ sizeof (CamelGroupwiseFolderClass),
+ (CamelObjectClassInitFunc) camel_groupwise_folder_class_init,
+ NULL,
+ (CamelObjectInitFunc) camel_groupwise_folder_init,
+ (CamelObjectFinalizeFunc) camel_groupwise_folder_finalize);
}
-
+
return camel_groupwise_folder_type;
}
-static int
+ static int
gw_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args)
{
CamelFolder *folder = (CamelFolder *)object ;
int i, count = 0 ;
guint32 tag ;
-
+
for (i=0 ; i<args->argc ; i++) {
CamelArgGet *arg = &args->argv[i] ;
@@ -1107,10 +1152,10 @@ gw_getv (CamelObject *object, CamelExcep
return 0;
-
+
}
-void
+ void
convert_to_calendar (EGwItem *item, char **str, int *len)
{
EGwItemOrganizer *org = e_gw_item_get_organizer(item) ;
@@ -1128,38 +1173,37 @@ convert_to_calendar (EGwItem *item, char
for (rl = recp_list ; rl != NULL ; rl = rl->next) {
EGwItemRecipient *recp = (EGwItemRecipient *) rl->data;
temp = g_strconcat (temp, "ATTENDEE;CN= ",recp->display_name,
- ";ROLE= REQ-PARTICIPANT:", "\n",
- " MAILTO:", recp->email, "\n", NULL) ;
+ ";ROLE= REQ-PARTICIPANT:", "\n",
+ " MAILTO:", recp->email, "\n", NULL) ;
}
}
*str = g_strconcat ("BEGIN:VCALENDAR","\n",
- "METHOD:REQUEST", "\n",
- "BEGIN:VEVENT", "\n",
- "UID:", e_gw_item_get_icalid (item), "\n",
- "X-GWITEM-TYPE:APPOINTMENT", "\n",
- "DTSTART:", e_gw_item_get_start_date (item), "\n",
- "SUMMARY:", e_gw_item_get_subject (item), "\n",
- "DTSTAMP:", e_gw_item_get_creation_date (item), "\n",
- "X-GWMESSAGEID:", e_gw_item_get_id(item), "\n",
- "X-GWSHOW-AS:BUSY", "\n",
- "X-GWRECORDID:", tmp [0], "\n",
- "ORGANIZER;CN= ",org ? org->display_name : "",
- ";ROLE= CHAIR:", "\n",
- " MAILTO:", org ? org->email : "", "\n",
- "DESCRIPTION:", desc ? desc : "" , "\n",
- temp ? temp : "", "\n",
- "DTEND:", e_gw_item_get_end_date (item), "\n",
- "LOCATION:", location ? location : "", "\n",
- "PRIORITY:",priority ? priority : "", "\n",
- //"UID:", e_gw_item_get_icalid (item), "\n", NULL) ;
- "END:VEVENT", "\n",
- "END:VCALENDAR","\n",
- NULL ) ;
-
- *len = strlen (*str) ;
-
- if (temp && strlen(temp))
- g_free (temp) ;
- g_strfreev (tmp);
+ "METHOD:REQUEST", "\n",
+ "BEGIN:VEVENT", "\n",
+ "X-GWITEM-TYPE:APPOINTMENT", "\n",
+ "DTSTART:", e_gw_item_get_start_date (item), "\n",
+ "SUMMARY:", e_gw_item_get_subject (item), "\n",
+ "DTSTAMP:", e_gw_item_get_creation_date (item), "\n",
+ "X-GWMESSAGEID:", e_gw_item_get_id(item), "\n",
+ "X-GWSHOW-AS:BUSY", "\n",
+ "X-GWRECORDID:", tmp [0], "\n",
+ "ORGANIZER;CN= ",org ? org->display_name : "",
+ ";ROLE= CHAIR:", "\n",
+ " MAILTO:", org ? org->email : "", "\n",
+ "DESCRIPTION:", desc ? desc : "" , "\n",
+ temp ? temp : "", "\n",
+ "DTEND:", e_gw_item_get_end_date (item), "\n",
+ "LOCATION:", location ? location : "", "\n",
+ "PRIORITY:",priority ? priority : "", "\n",
+ //"UID:", e_gw_item_get_icalid (item), "\n", NULL) ;
+ "END:VEVENT", "\n",
+ "END:VCALENDAR","\n",
+ NULL ) ;
+
+ *len = strlen (*str) ;
+
+ if (temp && strlen(temp))
+ g_free (temp) ;
+ g_strfreev (tmp);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]