aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2002-07-26 06:51:58 +0800
committerPeter Williams <peterw@src.gnome.org>2002-07-26 06:51:58 +0800
commit4f17d5a3cb380e772c4c4885ff8c52b25e66aeaf (patch)
tree1fc0d8858b7d952eb7324a48536ccbfe941dd5f1 /camel/providers
parent16fe42c893218a56e9b7fb1cd9418f8569a0f51f (diff)
downloadgsoc2013-evolution-4f17d5a3cb380e772c4c4885ff8c52b25e66aeaf.tar.gz
gsoc2013-evolution-4f17d5a3cb380e772c4c4885ff8c52b25e66aeaf.tar.zst
gsoc2013-evolution-4f17d5a3cb380e772c4c4885ff8c52b25e66aeaf.zip
Prototype.
2002-07-25 Peter Williams <peterw@ximian.com> * providers/imap/camel-imap-summary.h (camel_imap_summary_add_offline_uncached): Prototype. * providers/imap/camel-imap-summary.c (camel_imap_summary_add_offline_uncached): New function to add an uncached message to the summary while offline. * providers/imap/camel-imap-store.c (imap_connect_online): Only refresh the folders if the disco diary is empty (ie, we're not resyncing.) * providers/imap/camel-imap-folder.c (imap_transfer_offline): Emit an event for the source if deleting its originals. Also, if we can't load the message, still process it, using the new imap summary function. svn path=/trunk/; revision=17596
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 */