aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-folder.c16
-rw-r--r--camel/providers/imap/camel-imap-store.c2
-rw-r--r--camel/providers/imap/camel-imap-summary.c27
-rw-r--r--camel/providers/imap/camel-imap-summary.h4
4 files changed, 42 insertions, 7 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index cd82fb29aa..408b1fcc24 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -1260,21 +1260,25 @@ imap_transfer_offline (CamelFolder *source, GPtrArray *uids,
}
changes = camel_folder_change_info_new ();
+
for (i = 0; i < uids->len; i++) {
uid = uids->pdata[i];
- message = camel_folder_get_message (source, uid, NULL);
- if (!message)
- continue;
+ destuid = g_strdup_printf ("copy-%s:%s", source->full_name, uid);
+
mi = camel_folder_summary_uid (source->summary, uid);
g_return_if_fail (mi != NULL);
- destuid = g_strdup_printf ("copy-%s:%s", source->full_name, uid);
- camel_imap_summary_add_offline (dest->summary, destuid, message, mi);
+ message = camel_folder_get_message (source, uid, NULL);
+
+ if (message) {
+ camel_imap_summary_add_offline (dest->summary, destuid, message, mi);
+ camel_object_unref (CAMEL_OBJECT (message));
+ } else
+ camel_imap_summary_add_offline_uncached (dest->summary, destuid, mi);
camel_imap_message_cache_copy (sc, uid, dc, destuid, ex);
camel_folder_summary_info_free (source->summary, mi);
- camel_object_unref (CAMEL_OBJECT (message));
camel_folder_change_info_add_uid (changes, destuid);
if (transferred_uids)
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index a8455b4619..7781316f27 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -1114,7 +1114,7 @@ imap_connect_online (CamelService *service, CamelException *ex)
if (camel_exception_is_set (ex))
camel_service_disconnect (service, TRUE, NULL);
- else
+ else if (camel_disco_diary_empty (disco_store->diary))
imap_store_refresh_folders (store, ex);
return !camel_exception_is_set (ex);
diff --git a/camel/providers/imap/camel-imap-summary.c b/camel/providers/imap/camel-imap-summary.c
index f64cc00c19..ecfd6a1425 100644
--- a/camel/providers/imap/camel-imap-summary.c
+++ b/camel/providers/imap/camel-imap-summary.c
@@ -230,3 +230,30 @@ camel_imap_summary_add_offline (CamelFolderSummary *summary, const char *uid,
camel_message_info_set_uid (mi, g_strdup (uid));
camel_folder_summary_add (summary, mi);
}
+
+void
+camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary, const char *uid,
+ const CamelMessageInfo *info)
+{
+ CamelMessageInfo *mi;
+ CamelMessageContentInfo *ci;
+
+ /* Create summary entry */
+ mi = camel_folder_summary_info_new (summary);
+ ci = camel_folder_summary_content_info_new (summary);
+
+ camel_message_info_dup_to (info, mi);
+ mi->content = ci;
+
+ /* copy our private fields */
+ ((CamelImapMessageInfo *)mi)->server_flags =
+ ((CamelImapMessageInfo *)info)->server_flags;
+
+ /* Copy flags 'n' tags */
+ camel_flag_list_copy (&(mi->user_flags), &(info->user_flags));
+ camel_tag_list_copy (&(mi->user_tags), &(info->user_tags));
+
+ /* Set uid and add to summary */
+ camel_message_info_set_uid (mi, g_strdup (uid));
+ camel_folder_summary_add (summary, mi);
+}
diff --git a/camel/providers/imap/camel-imap-summary.h b/camel/providers/imap/camel-imap-summary.h
index 3b203f639b..817e884408 100644
--- a/camel/providers/imap/camel-imap-summary.h
+++ b/camel/providers/imap/camel-imap-summary.h
@@ -71,5 +71,9 @@ void camel_imap_summary_add_offline (CamelFolderSummary *summary,
CamelMimeMessage *message,
const CamelMessageInfo *info);
+void camel_imap_summary_add_offline_uncached (CamelFolderSummary *summary,
+ const char *uid,
+ const CamelMessageInfo *info);
+
#endif /* ! _CAMEL_IMAP_SUMMARY_H */