aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-08-17 06:17:30 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-08-17 06:17:30 +0800
commitcd0dd54c2b09301ceac71e8a0b47347e94c6d873 (patch)
tree3c962bc1a0fffa6012324f77212f45a99698d4c9 /camel/providers
parent907c848f766e970d003dec3ac4754534ec25c4d4 (diff)
downloadgsoc2013-evolution-cd0dd54c2b09301ceac71e8a0b47347e94c6d873.tar.gz
gsoc2013-evolution-cd0dd54c2b09301ceac71e8a0b47347e94c6d873.tar.zst
gsoc2013-evolution-cd0dd54c2b09301ceac71e8a0b47347e94c6d873.zip
Don't ever send "STORE FLAGS.SILENT ()" since Cyrus imapd doesn't like
2001-08-16 Jeffrey Stedfast <fejj@ximian.com> * providers/imap/camel-imap-folder.c (imap_sync_online): Don't ever send "STORE FLAGS.SILENT ()" since Cyrus imapd doesn't like this (and maybe others too?) so what we'll do instead is to send "STORE -FLAGS.SILENT (\Seen \Answered \Deleted \Marked)" to clear all the flags (since this is in essence what we want to do anyway). svn path=/trunk/; revision=12131
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index 9c6f9da093..d6ac6d3c82 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -611,10 +611,11 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
CamelMessageInfo *info;
GPtrArray *matches;
char *set, *flaglist;
+ gboolean unset;
int i, j, max;
-
+
CAMEL_IMAP_STORE_LOCK (store, command_lock);
-
+
/* Find a message with changed flags, find all of the other
* messages like it, sync them as a group, mark them as
* updated, and continue.
@@ -628,19 +629,30 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
camel_folder_summary_info_free (folder->summary, info);
continue;
}
-
- flaglist = imap_create_flag_list (info->flags);
+
+ /* Note: Cyrus will not accept an empty-set of flags
+ so... if this is true then we want to unset the
+ previously set flags.*/
+ unset = info->flags == CAMEL_MESSAGE_FOLDER_FLAGGED;
+
+ /* FIXME: since we don't know the previously set
+ flags, if unset is TRUE then assume all were set? */
+ flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags);
+
matches = get_matching (folder, info->flags & (CAMEL_IMAP_SERVER_FLAGS | CAMEL_MESSAGE_FOLDER_FLAGGED),
CAMEL_IMAP_SERVER_FLAGS | CAMEL_MESSAGE_FOLDER_FLAGGED, &set);
camel_folder_summary_info_free (folder->summary, info);
-
+
+ /* Note: to `unset' flags, use -FLAGS.SILENT (<flag list>) */
response = camel_imap_command (store, folder, ex,
- "UID STORE %s FLAGS.SILENT %s",
- set, flaglist);
+ "UID STORE %s %sFLAGS.SILENT %s",
+ set, unset ? "-" : "", flaglist);
g_free (set);
g_free (flaglist);
+
if (response)
camel_imap_response_free (store, response);
+
if (!camel_exception_is_set (ex)) {
for (j = 0; j < matches->len; j++) {
info = matches->pdata[j];
@@ -650,18 +662,19 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
}
camel_folder_summary_touch (folder->summary);
}
+
for (j = 0; j < matches->len; j++) {
info = matches->pdata[j];
camel_folder_summary_info_free (folder->summary, info);
}
g_ptr_array_free (matches, TRUE);
-
+
if (camel_exception_is_set (ex)) {
CAMEL_IMAP_STORE_UNLOCK (store, command_lock);
return;
}
}
-
+
/* Save the summary */
imap_sync_offline (folder, ex);