diff options
| author | Sankar P <psankar@novell.com> | 2007-06-11 06:56:01 +0000 |
|---|---|---|
| committer | Sankarasivasubramanian Pasupathilingam <psankar@src.gnome.org> | 2007-06-11 06:56:01 +0000 |
| commit | 640de300338b69f503b10f897a6ebd0b1dda2bd0 (patch) | |
| tree | 0f462826fdb4e036289291ff9933d63aa09ee801 | |
| parent | b93b9715302d2ea74a6fdea62f36a456992f31b4 (diff) | |
| download | evolution-data-server-640de300338b69f503b10f897a6ebd0b1dda2bd0.tar.gz | |
Fetches "Sent Items" in all folders. Also, fixes some bugs in moving mails
2007-06-11 Sankar P <psankar@novell.com>
* camel-groupwise-folder.c: (groupwise_refresh_folder),
(groupwise_transfer_messages_to):
Fetches "Sent Items" in all folders. Also, fixes some bugs
in moving mails across folders. Removes phantom removeRequests
svn path=/trunk/; revision=7815
| -rw-r--r-- | camel/providers/groupwise/ChangeLog | 7 | ||||
| -rw-r--r-- | camel/providers/groupwise/camel-groupwise-folder.c | 35 |
2 files changed, 34 insertions, 8 deletions
diff --git a/camel/providers/groupwise/ChangeLog b/camel/providers/groupwise/ChangeLog index 0f1319634..edf863752 100644 --- a/camel/providers/groupwise/ChangeLog +++ b/camel/providers/groupwise/ChangeLog @@ -1,3 +1,10 @@ +2007-06-11 Sankar P <psankar@novell.com> + + * camel-groupwise-folder.c: (groupwise_refresh_folder), + (groupwise_transfer_messages_to): + Fetches "Sent Items" in all folders. Also, fixes some bugs + in moving mails across folders. Removes phantom removeRequests + 2007-05-11 Srinivasa Ragavan <sragavan@novell.com> * camel-groupwise-provider.c: Fix fo bug #347326 from Ebby Wiselyn diff --git a/camel/providers/groupwise/camel-groupwise-folder.c b/camel/providers/groupwise/camel-groupwise-folder.c index bf91990ba..e32c29dcc 100644 --- a/camel/providers/groupwise/camel-groupwise-folder.c +++ b/camel/providers/groupwise/camel-groupwise-folder.c @@ -1063,9 +1063,17 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) /*Get the New Items*/ if (!is_proxy) { + char *source; + + if ( !strcmp (folder->full_name, RECEIVED) || !strcmp(folder->full_name, SENT) ) { + source = NULL; + } else { + source = "sent received"; + } + status = e_gw_connection_get_quick_messages (cnc, container_id, "peek id", - &t_str, "New", NULL, NULL, -1, &slist); + &t_str, "New", NULL, source, -1, &slist); if (status != E_GW_CONNECTION_STATUS_OK) { camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed")); goto end2; @@ -1102,7 +1110,7 @@ groupwise_refresh_folder(CamelFolder *folder, CamelException *ex) status = e_gw_connection_get_quick_messages (cnc, container_id, "peek id", - &t_str, "Modified", NULL, NULL, -1, &slist); + &t_str, "Modified", NULL, source, -1, &slist); if (status != E_GW_CONNECTION_STATUS_OK) { camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_INVALID, _("Authentication failed")); @@ -2044,10 +2052,12 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, CamelGroupwiseStorePrivate *priv = gw_store->priv; EGwConnectionStatus status; EGwConnection *cnc; + CamelFolderChangeInfo *changes = NULL; count = camel_folder_summary_count (destination->summary); qsort (uids->pdata, uids->len, sizeof (void *), uid_compar); + changes = camel_folder_change_info_new (); while (index < uids->len) { item_ids = g_list_append (item_ids, g_ptr_array_index (uids, index)); index ++; @@ -2085,8 +2095,10 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, if (camel_exception_is_set (ex)) break; - if (delete_originals) - camel_folder_delete_message(source, camel_message_info_uid (info)); + /* if (delete_originals) { + camel_folder_summary_remove_uid (source->summary, camel_message_info_uid(info)); + camel_data_cache_remove (((CamelGroupwiseFolder *)source)->cache, "cache", camel_message_info_uid(info), ex); + }*/ } CAMEL_SERVICE_REC_UNLOCK (source->parent_store, connect_lock); @@ -2133,6 +2145,7 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, wrapper = NULL; } + /* A User may mark a message as Unread and then immediately move it to some other folder. The following piece of code take care of such scenario. @@ -2157,17 +2170,23 @@ groupwise_transfer_messages_to (CamelFolder *source, GPtrArray *uids, else status = e_gw_connection_move_item (cnc, (const char *)uids->pdata[index], dest_container_id, NULL); + if (status == E_GW_CONNECTION_STATUS_OK) { - if (delete_originals) - camel_folder_delete_message(source, uids->pdata[index]); + if (delete_originals) { + camel_folder_summary_remove_uid (source->summary, uids->pdata[index]); + camel_folder_change_info_remove_uid (changes, uids->pdata[index]); + } } else { g_warning ("Warning!! Could not move item : %s\n", (char *)uids->pdata[index]); } index ++; } + + camel_object_trigger_event (source, "folder_changed", changes); + camel_folder_change_info_free (changes); + /* Refresh the destination folder, if its not refreshed already */ - if (gw_store->current_folder != destination || - camel_folder_summary_count (destination->summary) == count) + if (gw_store->current_folder != destination ) camel_folder_refresh_info (destination, ex); camel_folder_summary_touch (source->summary); |
