aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-disco-folder.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-05-30 01:08:53 +0800
committerDan Winship <danw@src.gnome.org>2001-05-30 01:08:53 +0800
commit11ea26d0e33405490795a766406d5e065b6b9234 (patch)
treebe249f7528c0a8b17cdd0890d40684f12eeb50e5 /camel/camel-disco-folder.c
parentefabbb93c9f61e583d835d1735834cc5bd0ce63c (diff)
downloadgsoc2013-evolution-11ea26d0e33405490795a766406d5e065b6b9234.tar.gz
gsoc2013-evolution-11ea26d0e33405490795a766406d5e065b6b9234.tar.zst
gsoc2013-evolution-11ea26d0e33405490795a766406d5e065b6b9234.zip
Code for logging and replaying offline operations.
* camel-disco-diary.c: Code for logging and replaying offline operations. * camel-disco-store.c (disco_construct): Set disco->status here (where we can base it on the session's offline status) rather than at init time. (disco_connect): If we connect online and have a non-empty diary, switch to RESYNCING mode and replay the diary to the server. (disco_get_folder, disco_get_folder_info): Add _resyncing variants. * camel-disco-folder.c (disco_sync, disco_expunge_uids, disco_append_message, disco_copy_messages_to, disco_move_messages_to): Add _resyncing variants to switches. (disco_expunge_uids, disco_append_message, disco_copy_messages_to, disco_move_messages_to): Remove #ifdef'ed out diary code: let the provider do it. (disco_append_message): Redo the append methods to no longer return the UID, since we're no longer doing the logging from here. svn path=/trunk/; revision=10040
Diffstat (limited to 'camel/camel-disco-folder.c')
-rw-r--r--camel/camel-disco-folder.c54
1 files changed, 22 insertions, 32 deletions
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index b090bd6517..f3581bce19 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -116,6 +116,10 @@ disco_sync (CamelFolder *folder, gboolean expunge, CamelException *ex)
case CAMEL_DISCO_STORE_OFFLINE:
CDF_CLASS (folder)->sync_offline (folder, ex);
break;
+
+ case CAMEL_DISCO_STORE_RESYNCING:
+ CDF_CLASS (folder)->sync_resyncing (folder, ex);
+ break;
}
}
@@ -134,13 +138,10 @@ disco_expunge_uids (CamelFolder *folder, GPtrArray *uids, CamelException *ex)
case CAMEL_DISCO_STORE_OFFLINE:
CDF_CLASS (folder)->expunge_uids_offline (folder, uids, ex);
-#ifdef NOTYET
- if (!camel_exception_is_set (ex)) {
- camel_disco_diary_log (disco->diary,
- CAMEL_DISCO_DIARY_FOLDER_EXPUNGE,
- folder, uids);
- }
-#endif
+ break;
+
+ case CAMEL_DISCO_STORE_RESYNCING:
+ CDF_CLASS (folder)->expunge_uids_resyncing (folder, uids, ex);
break;
}
}
@@ -173,25 +174,20 @@ disco_append_message (CamelFolder *folder, CamelMimeMessage *message,
const CamelMessageInfo *info, CamelException *ex)
{
CamelDiscoStore *disco = CAMEL_DISCO_STORE (folder->parent_store);
- char *uid;
switch (camel_disco_store_status (disco)) {
case CAMEL_DISCO_STORE_ONLINE:
- uid = CDF_CLASS (folder)->append_online (folder, message, info, ex);
+ CDF_CLASS (folder)->append_online (folder, message, info, ex);
break;
case CAMEL_DISCO_STORE_OFFLINE:
- uid = CDF_CLASS (folder)->append_offline (folder, message, info, ex);
-#ifdef NOTYET
- if (uid) {
- camel_disco_diary_log (disco->diary,
- CAMEL_DISCO_DIARY_FOLDER_APPEND,
- folder, uid);
- }
-#endif
+ CDF_CLASS (folder)->append_offline (folder, message, info, ex);
+ break;
+
+ case CAMEL_DISCO_STORE_RESYNCING:
+ CDF_CLASS (folder)->append_resyncing (folder, message, info, ex);
break;
}
- g_free (uid);
}
static void
@@ -207,13 +203,10 @@ disco_copy_messages_to (CamelFolder *source, GPtrArray *uids,
case CAMEL_DISCO_STORE_OFFLINE:
CDF_CLASS (source)->copy_offline (source, uids, destination, ex);
-#ifdef NOTYET
- if (!camel_exception_is_set (ex)) {
- camel_disco_diary_log (disco->diary,
- CAMEL_DISCO_DIARY_FOLDER_COPY,
- source, destination, uids);
- }
-#endif
+ break;
+
+ case CAMEL_DISCO_STORE_RESYNCING:
+ CDF_CLASS (source)->copy_resyncing (source, uids, destination, ex);
break;
}
}
@@ -231,13 +224,10 @@ disco_move_messages_to (CamelFolder *source, GPtrArray *uids,
case CAMEL_DISCO_STORE_OFFLINE:
CDF_CLASS (source)->move_offline (source, uids, destination, ex);
-#ifdef NOTYET
- if (!camel_exception_is_set (ex)) {
- camel_disco_diary_log (disco->diary,
- CAMEL_DISCO_DIARY_FOLDER_MOVE,
- source, destination, uids);
- }
-#endif
+ break;
+
+ case CAMEL_DISCO_STORE_RESYNCING:
+ CDF_CLASS (source)->move_resyncing (source, uids, destination, ex);
break;
}
}