diff options
author | Dan Winship <danw@src.gnome.org> | 2001-05-30 01:09:12 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-05-30 01:09:12 +0800 |
commit | 43795a43b5c5b8ccb40cdc3379d168d7208ea5a6 (patch) | |
tree | 9cc08f6fb26ad6f8f8249ea6406fa9eb3bd7476c /camel/providers/imap/camel-imap-utils.c | |
parent | 11ea26d0e33405490795a766406d5e065b6b9234 (diff) | |
download | gsoc2013-evolution-43795a43b5c5b8ccb40cdc3379d168d7208ea5a6.tar.gz gsoc2013-evolution-43795a43b5c5b8ccb40cdc3379d168d7208ea5a6.tar.zst gsoc2013-evolution-43795a43b5c5b8ccb40cdc3379d168d7208ea5a6.zip |
Create a CamelDiscoDiary. (imap_disconnect_offline): And free it.
* providers/imap/camel-imap-store.c (imap_connect_online,
imap_connect_offline): Create a CamelDiscoDiary.
(imap_disconnect_offline): And free it.
* providers/imap/camel-imap-folder.c (camel_imap_folder_selected):
If RESYNCING, don't do any sort of checking that the remote folder
matches the summary, beyond making sure that the UIDVALIDITY is
correct.
(imap_rescan): Add a missing camel_folder_summary_info_free when
removing a UID from the summary.
(imap_expunge_uids_offline): Implement. Fairly simple.
(imap_expunge_uids_resyncing): Implement. If the store supports
UIDPLUS, we can just use imap_expunge_uids_online. If not, we need
to temporarily undelete any messages marked deleted on the server
that aren't supposed to get expunged.
(imap_append_offline): Implement, using cache and summary
operations, and triggering the folder_changed event by hand.
(imap_append_resyncing): Implement. Redo imap_append_online a bit
in the process to make them able to share more code.
(imap_copy_offline): Implement.
(imap_copy_online): Move parts of this out into a helper.
(imap_copy_resyncing): Implement. In most cases this is just like
imap_copy_online, but if you are copying a message that was itself
copied or appended into the folder, and the server doesn't do
UIDPLUS, it will be necessary to replace at least part of the copy
operation with one or more appends.
* providers/imap/camel-imap-command.c (imap_read_response): Don't
record the current folder in the response when in RESYNCING mode.
(This means that EXISTS and EXPUNGE responses won't be processed,
which is needed because the summary may not match the folder at
this point.)
(imap_read_response): On error, call
camel_imap_response_free_without_processing, not
camel_imap_response_free.
* providers/imap/camel-imap-utils.c (imap_uid_array_to_set): Make
this work better when operating on UIDs that aren't in the summary.
* providers/imap/camel-imap-summary.c
(camel_imap_summary_add_offline): New routine used by
imap_append_offline and imap_copy_offline to create new summary
entries.
svn path=/trunk/; revision=10041
Diffstat (limited to 'camel/providers/imap/camel-imap-utils.c')
-rw-r--r-- | camel/providers/imap/camel-imap-utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c index 0d61373b6e..3f581b0c17 100644 --- a/camel/providers/imap/camel-imap-utils.c +++ b/camel/providers/imap/camel-imap-utils.c @@ -585,8 +585,11 @@ get_summary_uid_numeric (CamelFolderSummary *summary, int index) * @summary: summary for the folder the UIDs come from * @uids: a (sorted) array of UIDs * - * Return value: an IMAP "set" covering the listed UIDs, which the - * caller must free with g_free(). + * Creates an IMAP "set" covering the listed UIDs and not covering + * any UIDs that are in @summary but not in @uids. It doesn't + * actually require that all (or any) of the UIDs be in @summary. + * + * Return value: the set, which the caller must free with g_free() **/ char * imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids) @@ -597,6 +600,8 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids) GString *gset; char *set; + g_return_val_if_fail (uids->len > 0, NULL); + gset = g_string_new (uids->pdata[0]); last_uid = strtoul (uids->pdata[0], NULL, 10); next_summary_uid = 0; @@ -613,7 +618,7 @@ imap_uid_array_to_set (CamelFolderSummary *summary, GPtrArray *uids) /* Now get the next UID from @uids */ this_uid = strtoul (uids->pdata[ui], NULL, 10); - if (this_uid == next_summary_uid) + if (this_uid == next_summary_uid || this_uid == last_uid + 1) range = TRUE; else { if (range) { |