aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c15
-rw-r--r--camel/providers/imap/camel-imap-store.c19
2 files changed, 14 insertions, 20 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index fda6701693..0dec157509 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -488,7 +488,7 @@ imap_refresh_info (CamelFolder *folder, CamelException *ex)
CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
response = camel_imap_command (imap_store, folder, ex, NULL);
if (response) {
- camel_imap_folder_selected (folder, response, NULL);
+ camel_imap_folder_selected (folder, response, ex);
camel_imap_response_free (imap_store, response);
}
return;
@@ -715,6 +715,7 @@ get_matching (CamelFolder *folder, guint32 flags, guint32 mask, char **set)
g_string_free (gset, FALSE);
return matches;
} else {
+ *set = NULL
g_string_free (gset, TRUE);
g_ptr_array_free (matches, TRUE);
return NULL;
@@ -760,11 +761,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
empty-set of flags so... if this is true then we
want to unset the previously set flags.*/
unset = !(info->flags & CAMEL_IMAP_SERVER_FLAGS);
-
- /* FIXME: since we don't know the previously set flags,
- if unset is TRUE then just unset all the flags? */
- flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags);
-
+
/* Note: get_matching() uses UID_SET_LIMIT to limit
the size of the uid-set string. We don't have to
loop here to flush all the matching uids because
@@ -773,7 +770,13 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
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);
+ if (matches == NULL)
+ continue;
+ /* FIXME: since we don't know the previously set flags,
+ if unset is TRUE then just unset all the flags? */
+ flaglist = imap_create_flag_list (unset ? CAMEL_IMAP_SERVER_FLAGS : info->flags);
+
/* Note: to `unset' flags, use -FLAGS.SILENT (<flag list>) */
response = camel_imap_command (store, folder, &local_ex,
"UID STORE %s %sFLAGS.SILENT %s",
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index fe0a04f8dc..1da03ffdef 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -944,24 +944,16 @@ imap_check_folder_still_extant (CamelImapStore *imap_store, const char *full_nam
full_name);
if (response) {
- gboolean stillthere = FALSE;
-
- if (response->untagged->len)
- stillthere = TRUE;
+ gboolean stillthere = response->untagged->len != 0;
camel_imap_response_free_without_processing (imap_store, response);
- if (stillthere)
- return TRUE;
+ return stillthere;
}
- /* either LIST command was rejected or it gave no results,
- * we can be sure that the folder is gone. */
-
- camel_exception_setv (ex, CAMEL_EXCEPTION_FOLDER_INVALID,
- _("The folder %s no longer exists"),
- full_name);
- return FALSE;
+ /* if the command was rejected, there must be some other error,
+ assume it worked so we dont blow away the folder unecessarily */
+ return TRUE;
}
static void
@@ -1008,7 +1000,6 @@ imap_store_refresh_folders (CamelImapStore *store, CamelException *ex)
camel_object_unref((CamelObject *)folder);
imap_folder_effectively_unsubscribed (store, namedup, ex);
imap_forget_folder (store, namedup, ex);
- camel_exception_clear (ex);
g_free (namedup);
} else
camel_object_unref((CamelObject *)folder);