[evolution-data-server/wip/mcrha/libical-glib] Add operation-flags to some calendar operations



commit 9a1639f34fbabd817b7826fc754ff9396b2e9fd6
Author: Milan Crha <mcrha redhat com>
Date:   Thu Feb 28 13:59:24 2019 +0100

    Add operation-flags to some calendar operations
    
    These can influence the behavior in the future, like when being used
    by the issue number 59. This is only a preparation for it, to not
    change API too many times.

 .../backends/caldav/e-cal-backend-caldav.c         |   3 +
 .../backends/contacts/e-cal-backend-contacts.c     |   3 +
 src/calendar/backends/file/e-cal-backend-file.c    |   5 +
 .../backends/gtasks/e-cal-backend-gtasks.c         |   2 +
 .../backends/weather/e-cal-backend-weather.c       |   3 +-
 src/calendar/libecal/e-cal-client.c                |  99 ++++++--
 src/calendar/libecal/e-cal-client.h                |  18 ++
 src/calendar/libecal/e-cal-enums.h                 |  35 ++-
 src/calendar/libecal/e-cal-util.c                  |  56 +++++
 src/calendar/libecal/e-cal-util.h                  |   6 +
 src/calendar/libecal/e-reminder-watcher.c          |   1 +
 src/calendar/libedata-cal/e-cal-backend-sync.c     |  54 +++--
 src/calendar/libedata-cal/e-cal-backend-sync.h     |  12 +
 src/calendar/libedata-cal/e-cal-backend.c          |  60 ++++-
 src/calendar/libedata-cal/e-cal-backend.h          |  30 ++-
 src/calendar/libedata-cal/e-cal-cache.c            | 253 +++++++++++++++++----
 src/calendar/libedata-cal/e-cal-cache.h            |  22 +-
 src/calendar/libedata-cal/e-cal-meta-backend.c     | 104 +++++----
 src/calendar/libedata-cal/e-cal-meta-backend.h     |   4 +
 src/calendar/libedata-cal/e-data-cal.c             |  15 +-
 src/libebackend/e-backend-enums.h                  |  22 --
 src/libedataserver/e-source-enums.h                |  22 ++
 .../org.gnome.evolution.dataserver.Calendar.xml    |   6 +
 tests/libecal/test-cal-client-bulk-methods.c       |  16 +-
 tests/libecal/test-cal-client-create-object.c      |   4 +-
 .../libecal/test-cal-client-get-attachment-uris.c  |   2 +-
 tests/libecal/test-cal-client-get-free-busy.c      |   2 +-
 tests/libecal/test-cal-client-get-object-list.c    |   2 +-
 tests/libecal/test-cal-client-get-revision.c       |   4 +-
 tests/libecal/test-cal-client-get-view.c           |   6 +-
 tests/libecal/test-cal-client-modify-object.c      |   6 +-
 tests/libecal/test-cal-client-receive-objects.c    |   4 +-
 tests/libecal/test-cal-client-refresh.c            |   2 +-
 tests/libecal/test-cal-client-remove-object.c      |   8 +-
 tests/libecal/test-cal-client-revision-view.c      |   6 +-
 tests/libecal/test-cal-client-send-objects.c       |   4 +-
 tests/libedata-cal/test-cal-cache-intervals.c      |   6 +-
 tests/libedata-cal/test-cal-cache-offline.c        |  89 ++++++--
 tests/libedata-cal/test-cal-cache-utils.c          |   2 +-
 tests/libedata-cal/test-cal-meta-backend.c         | 128 ++++++-----
 40 files changed, 850 insertions(+), 276 deletions(-)
---
diff --git a/src/calendar/backends/caldav/e-cal-backend-caldav.c 
b/src/calendar/backends/caldav/e-cal-backend-caldav.c
index 11cfe184e..614eed834 100644
--- a/src/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/src/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -617,6 +617,7 @@ ecb_caldav_search_changes_cb (ECalCache *cal_cache,
                              const gchar *revision,
                              const gchar *object,
                              const gchar *extra,
+                             guint32 custom_flags,
                              EOfflineState offline_state,
                              gpointer user_data)
 {
@@ -1221,6 +1222,7 @@ ecb_caldav_save_component_sync (ECalMetaBackend *meta_backend,
                                EConflictResolution conflict_resolution,
                                const GSList *instances,
                                const gchar *extra,
+                               guint32 opflags,
                                gchar **out_new_uid,
                                gchar **out_new_extra,
                                GCancellable *cancellable,
@@ -1348,6 +1350,7 @@ ecb_caldav_remove_component_sync (ECalMetaBackend *meta_backend,
                                  const gchar *uid,
                                  const gchar *extra,
                                  const gchar *object,
+                                 guint32 opflags,
                                  GCancellable *cancellable,
                                  GError **error)
 {
diff --git a/src/calendar/backends/contacts/e-cal-backend-contacts.c 
b/src/calendar/backends/contacts/e-cal-backend-contacts.c
index 7a5e3995f..813da7150 100644
--- a/src/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/src/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -1162,6 +1162,7 @@ e_cal_backend_contacts_receive_objects (ECalBackendSync *backend,
                                         EDataCal *cal,
                                         GCancellable *cancellable,
                                         const gchar *calobj,
+                                       guint32 opflags,
                                         GError **perror)
 {
        g_propagate_error (perror, EDC_ERROR (PermissionDenied));
@@ -1172,6 +1173,7 @@ e_cal_backend_contacts_send_objects (ECalBackendSync *backend,
                                      EDataCal *cal,
                                      GCancellable *cancellable,
                                      const gchar *calobj,
+                                    guint32 opflags,
                                      GSList **users,
                                      gchar **modified_calobj,
                                      GError **perror)
@@ -1408,6 +1410,7 @@ e_cal_backend_contacts_create_objects (ECalBackendSync *backend,
                                        EDataCal *cal,
                                        GCancellable *cancellable,
                                        const GSList *calobjs,
+                                      guint32 opflags,
                                        GSList **uids,
                                        GSList **new_components,
                                        GError **perror)
diff --git a/src/calendar/backends/file/e-cal-backend-file.c b/src/calendar/backends/file/e-cal-backend-file.c
index 3f3a0aa69..1a5f7a045 100644
--- a/src/calendar/backends/file/e-cal-backend-file.c
+++ b/src/calendar/backends/file/e-cal-backend-file.c
@@ -2259,6 +2259,7 @@ e_cal_backend_file_create_objects (ECalBackendSync *backend,
                                    EDataCal *cal,
                                    GCancellable *cancellable,
                                    const GSList *in_calobjs,
+                                  guint32 opflags,
                                    GSList **uids,
                                    GSList **new_components,
                                    GError **error)
@@ -2438,6 +2439,7 @@ e_cal_backend_file_modify_objects (ECalBackendSync *backend,
                                    GCancellable *cancellable,
                                    const GSList *calobjs,
                                    ECalObjModType mod,
+                                  guint32 opflags,
                                    GSList **old_components,
                                    GSList **new_components,
                                    GError **error)
@@ -3042,6 +3044,7 @@ e_cal_backend_file_remove_objects (ECalBackendSync *backend,
                                    GCancellable *cancellable,
                                    const GSList *ids,
                                    ECalObjModType mod,
+                                  guint32 opflags,
                                    GSList **old_components,
                                    GSList **new_components,
                                    GError **error)
@@ -3367,6 +3370,7 @@ e_cal_backend_file_receive_objects (ECalBackendSync *backend,
                                     EDataCal *cal,
                                     GCancellable *cancellable,
                                     const gchar *calobj,
+                                   guint32 opflags,
                                     GError **error)
 {
        ESourceRegistry *registry;
@@ -3673,6 +3677,7 @@ e_cal_backend_file_send_objects (ECalBackendSync *backend,
                                  EDataCal *cal,
                                  GCancellable *cancellable,
                                  const gchar *calobj,
+                                guint32 opflags,
                                  GSList **users,
                                  gchar **modified_calobj,
                                  GError **perror)
diff --git a/src/calendar/backends/gtasks/e-cal-backend-gtasks.c 
b/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
index 26b22edbf..cfa5abdbc 100644
--- a/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
+++ b/src/calendar/backends/gtasks/e-cal-backend-gtasks.c
@@ -867,6 +867,7 @@ ecb_gtasks_save_component_sync (ECalMetaBackend *meta_backend,
                                EConflictResolution conflict_resolution,
                                const GSList *instances, /* ECalComponent * */
                                const gchar *extra,
+                               guint32 opflags,
                                gchar **out_new_uid,
                                gchar **out_new_extra,
                                GCancellable *cancellable,
@@ -961,6 +962,7 @@ ecb_gtasks_remove_component_sync (ECalMetaBackend *meta_backend,
                                  const gchar *uid,
                                  const gchar *extra,
                                  const gchar *object,
+                                 guint32 opflags,
                                  GCancellable *cancellable,
                                  GError **error)
 {
diff --git a/src/calendar/backends/weather/e-cal-backend-weather.c 
b/src/calendar/backends/weather/e-cal-backend-weather.c
index 4bd7532aa..f24029813 100644
--- a/src/calendar/backends/weather/e-cal-backend-weather.c
+++ b/src/calendar/backends/weather/e-cal-backend-weather.c
@@ -133,7 +133,7 @@ static void
 put_component_to_store (ECalBackendWeather *cb,
                         ECalComponent *comp)
 {
-       e_cal_cache_put_component (cb->priv->cache, comp, NULL, E_CACHE_IS_ONLINE, NULL, NULL);
+       e_cal_cache_put_component (cb->priv->cache, comp, NULL, 0, E_CACHE_IS_ONLINE, NULL, NULL);
 }
 
 static gint
@@ -732,6 +732,7 @@ e_cal_backend_weather_receive_objects (ECalBackendSync *backend,
                                        EDataCal *cal,
                                        GCancellable *cancellable,
                                        const gchar *calobj,
+                                      guint32 opflags,
                                        GError **perror)
 {
        g_propagate_error (perror, EDC_ERROR (PermissionDenied));
diff --git a/src/calendar/libecal/e-cal-client.c b/src/calendar/libecal/e-cal-client.c
index fe63e5316..289985c7d 100644
--- a/src/calendar/libecal/e-cal-client.c
+++ b/src/calendar/libecal/e-cal-client.c
@@ -90,6 +90,7 @@ struct _AsyncContext {
        ECalObjModType mod;
        time_t start;
        time_t end;
+       guint32 opflags;
 };
 
 struct _SignalClosure {
@@ -4597,6 +4598,7 @@ cal_client_create_object_thread (GSimpleAsyncResult *simple,
        if (!e_cal_client_create_object_sync (
                E_CAL_CLIENT (source_object),
                async_context->in_comp,
+               async_context->opflags,
                &async_context->uid,
                cancellable, &local_error)) {
 
@@ -4615,6 +4617,7 @@ cal_client_create_object_thread (GSimpleAsyncResult *simple,
  * e_cal_client_create_object:
  * @client: an #ECalClient
  * @icalcomp: The component to create
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -4630,6 +4633,7 @@ cal_client_create_object_thread (GSimpleAsyncResult *simple,
 void
 e_cal_client_create_object (ECalClient *client,
                             ICalComponent *icalcomp,
+                           guint32 opflags,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
@@ -4642,6 +4646,7 @@ e_cal_client_create_object (ECalClient *client,
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->in_comp = i_cal_component_new_clone (icalcomp);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -4707,6 +4712,7 @@ e_cal_client_create_object_finish (ECalClient *client,
  * e_cal_client_create_object_sync:
  * @client: an #ECalClient
  * @icalcomp: The component to create
+ * @opflags: bit-or of #ECalOperationFlags
  * @out_uid: (out) (nullable): Return value for the UID assigned to the new component
  *           by the calendar backend
  * @cancellable: a #GCancellable; can be %NULL
@@ -4725,6 +4731,7 @@ e_cal_client_create_object_finish (ECalClient *client,
 gboolean
 e_cal_client_create_object_sync (ECalClient *client,
                                  ICalComponent *icalcomp,
+                                guint32 opflags,
                                  gchar **out_uid,
                                  GCancellable *cancellable,
                                  GError **error)
@@ -4737,7 +4744,7 @@ e_cal_client_create_object_sync (ECalClient *client,
        g_return_val_if_fail (icalcomp != NULL, FALSE);
 
        success = e_cal_client_create_objects_sync (
-               client, &link, &string_list, cancellable, error);
+               client, &link, opflags, &string_list, cancellable, error);
 
        /* Sanity check. */
        g_return_val_if_fail (
@@ -4768,6 +4775,7 @@ cal_client_create_objects_thread (GSimpleAsyncResult *simple,
        if (!e_cal_client_create_objects_sync (
                E_CAL_CLIENT (source_object),
                async_context->comp_list,
+               async_context->opflags,
                &async_context->string_list,
                cancellable, &local_error)) {
 
@@ -4786,6 +4794,7 @@ cal_client_create_objects_thread (GSimpleAsyncResult *simple,
  * e_cal_client_create_objects:
  * @client: an #ECalClient
  * @icalcomps: (element-type ICalComponent): The components to create
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: (allow-none): a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -4801,6 +4810,7 @@ cal_client_create_objects_thread (GSimpleAsyncResult *simple,
 void
 e_cal_client_create_objects (ECalClient *client,
                              GSList *icalcomps,
+                            guint32 opflags,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
@@ -4814,6 +4824,7 @@ e_cal_client_create_objects (ECalClient *client,
        async_context = g_slice_new0 (AsyncContext);
        async_context->comp_list = g_slist_copy_deep (
                icalcomps, (GCopyFunc) i_cal_component_new_clone, NULL);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -4879,6 +4890,7 @@ e_cal_client_create_objects_finish (ECalClient *client,
  * e_cal_client_create_objects_sync:
  * @client: an #ECalClient
  * @icalcomps: (element-type ICalComponent): The components to create
+ * @opflags: bit-or of #ECalOperationFlags
  * @out_uids: (out) (nullable) (element-type utf8): Return value for the UIDs assigned
  *            to the new components by the calendar backend
  * @cancellable: (allow-none): a #GCancellable; can be %NULL
@@ -4898,6 +4910,7 @@ e_cal_client_create_objects_finish (ECalClient *client,
 gboolean
 e_cal_client_create_objects_sync (ECalClient *client,
                                   GSList *icalcomps,
+                                 guint32 opflags,
                                   GSList **out_uids,
                                   GCancellable *cancellable,
                                   GError **error)
@@ -4925,7 +4938,7 @@ e_cal_client_create_objects_sync (ECalClient *client,
        e_dbus_calendar_call_create_objects_sync (
                client->priv->dbus_proxy,
                (const gchar * const *) strv,
-               &uids, cancellable, &local_error);
+               opflags, &uids, cancellable, &local_error);
 
        g_strfreev (strv);
 
@@ -4974,6 +4987,7 @@ cal_client_modify_object_thread (GSimpleAsyncResult *simple,
                E_CAL_CLIENT (source_object),
                async_context->in_comp,
                async_context->mod,
+               async_context->opflags,
                cancellable, &local_error)) {
 
                if (!local_error)
@@ -4992,6 +5006,7 @@ cal_client_modify_object_thread (GSimpleAsyncResult *simple,
  * @client: an #ECalClient
  * @icalcomp: Component to modify
  * @mod: Type of modification
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -5013,6 +5028,7 @@ void
 e_cal_client_modify_object (ECalClient *client,
                             ICalComponent *icalcomp,
                             ECalObjModType mod,
+                           guint32 opflags,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
@@ -5026,6 +5042,7 @@ e_cal_client_modify_object (ECalClient *client,
        async_context = g_slice_new0 (AsyncContext);
        async_context->in_comp = i_cal_component_new_clone (icalcomp);
        async_context->mod = mod;
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -5078,6 +5095,7 @@ e_cal_client_modify_object_finish (ECalClient *client,
  * @client: an #ECalClient
  * @icalcomp: Component to modify
  * @mod: Type of modification
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
@@ -5097,6 +5115,7 @@ gboolean
 e_cal_client_modify_object_sync (ECalClient *client,
                                  ICalComponent *icalcomp,
                                  ECalObjModType mod,
+                                guint32 opflags,
                                  GCancellable *cancellable,
                                  GError **error)
 {
@@ -5106,7 +5125,7 @@ e_cal_client_modify_object_sync (ECalClient *client,
        g_return_val_if_fail (icalcomp != NULL, FALSE);
 
        return e_cal_client_modify_objects_sync (
-               client, &link, mod, cancellable, error);
+               client, &link, mod, opflags, cancellable, error);
 }
 
 /* Helper for e_cal_client_modify_objects() */
@@ -5124,6 +5143,7 @@ cal_client_modify_objects_thread (GSimpleAsyncResult *simple,
                E_CAL_CLIENT (source_object),
                async_context->comp_list,
                async_context->mod,
+               async_context->opflags,
                cancellable, &local_error)) {
 
                if (!local_error)
@@ -5142,6 +5162,7 @@ cal_client_modify_objects_thread (GSimpleAsyncResult *simple,
  * @client: an #ECalClient
  * @icalcomps: (element-type ICalComponent): Components to modify
  * @mod: Type of modification
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: (allow-none): a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -5163,6 +5184,7 @@ void
 e_cal_client_modify_objects (ECalClient *client,
                              GSList *icalcomps,
                              ECalObjModType mod,
+                            guint32 opflags,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
@@ -5177,6 +5199,7 @@ e_cal_client_modify_objects (ECalClient *client,
        async_context->comp_list = g_slist_copy_deep (
                icalcomps, (GCopyFunc) i_cal_component_new_clone, NULL);
        async_context->mod = mod;
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -5229,6 +5252,7 @@ e_cal_client_modify_objects_finish (ECalClient *client,
  * @client: an #ECalClient
  * @icalcomps: (element-type ICalComponent): Components to modify
  * @mod: Type of modification
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: (allow-none): a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
@@ -5248,12 +5272,13 @@ gboolean
 e_cal_client_modify_objects_sync (ECalClient *client,
                                   GSList *icalcomps,
                                   ECalObjModType mod,
+                                 guint32 opflags,
                                   GCancellable *cancellable,
                                   GError **error)
 {
        GFlagsClass *flags_class;
        GFlagsValue *flags_value;
-       GString *flags;
+       GString *mod_flags;
        gchar **strv;
        gint ii = 0;
        GError *local_error = NULL;
@@ -5261,13 +5286,13 @@ e_cal_client_modify_objects_sync (ECalClient *client,
        g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
        g_return_val_if_fail (icalcomps != NULL, FALSE);
 
-       flags = g_string_new (NULL);
+       mod_flags = g_string_new (NULL);
        flags_class = g_type_class_ref (E_TYPE_CAL_OBJ_MOD_TYPE);
        flags_value = g_flags_get_first_value (flags_class, mod);
        while (flags_value != NULL) {
-               if (flags->len > 0)
-                       g_string_append_c (flags, ':');
-               g_string_append (flags, flags_value->value_nick);
+               if (mod_flags->len > 0)
+                       g_string_append_c (mod_flags, ':');
+               g_string_append (mod_flags, flags_value->value_nick);
                mod &= ~flags_value->value;
                flags_value = g_flags_get_first_value (flags_class, mod);
        }
@@ -5286,12 +5311,12 @@ e_cal_client_modify_objects_sync (ECalClient *client,
        e_dbus_calendar_call_modify_objects_sync (
                client->priv->dbus_proxy,
                (const gchar * const *) strv,
-               flags->str, cancellable, &local_error);
+               mod_flags->str, opflags, cancellable, &local_error);
 
        g_strfreev (strv);
 
        g_type_class_unref (flags_class);
-       g_string_free (flags, TRUE);
+       g_string_free (mod_flags, TRUE);
 
        if (local_error != NULL) {
                g_dbus_error_strip_remote_error (local_error);
@@ -5318,6 +5343,7 @@ cal_client_remove_object_thread (GSimpleAsyncResult *simple,
                async_context->uid,
                async_context->rid,
                async_context->mod,
+               async_context->opflags,
                cancellable, &local_error)) {
 
                if (!local_error)
@@ -5337,6 +5363,7 @@ cal_client_remove_object_thread (GSimpleAsyncResult *simple,
  * @uid: UID of the object to remove
  * @rid: Recurrence ID of the specific recurrence to remove
  * @mod: Type of the removal
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -5357,6 +5384,7 @@ e_cal_client_remove_object (ECalClient *client,
                             const gchar *uid,
                             const gchar *rid,
                             ECalObjModType mod,
+                           guint32 opflags,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
@@ -5372,6 +5400,7 @@ e_cal_client_remove_object (ECalClient *client,
        async_context->uid = g_strdup (uid);
        async_context->rid = g_strdup (rid);
        async_context->mod = mod;
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -5425,6 +5454,7 @@ e_cal_client_remove_object_finish (ECalClient *client,
  * @uid: UID of the object to remove
  * @rid: Recurrence ID of the specific recurrence to remove
  * @mod: Type of the removal
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
@@ -5443,6 +5473,7 @@ e_cal_client_remove_object_sync (ECalClient *client,
                                  const gchar *uid,
                                  const gchar *rid,
                                  ECalObjModType mod,
+                                guint32 opflags,
                                  GCancellable *cancellable,
                                  GError **error)
 {
@@ -5456,7 +5487,7 @@ e_cal_client_remove_object_sync (ECalClient *client,
        id = e_cal_component_id_new (uid, rid);
        link = g_slist_prepend (NULL, id);
 
-       success = e_cal_client_remove_objects_sync (client, link, mod, cancellable, error);
+       success = e_cal_client_remove_objects_sync (client, link, mod, opflags, cancellable, error);
 
        g_slist_free_full (link, e_cal_component_id_free);
 
@@ -5478,6 +5509,7 @@ cal_client_remove_objects_thread (GSimpleAsyncResult *simple,
                E_CAL_CLIENT (source_object),
                async_context->ids_list,
                async_context->mod,
+               async_context->opflags,
                cancellable, &local_error)) {
 
                if (!local_error)
@@ -5497,6 +5529,7 @@ cal_client_remove_objects_thread (GSimpleAsyncResult *simple,
  * @ids: (element-type ECalComponentId): A list of #ECalComponentId objects
  * identifying the objects to remove
  * @mod: Type of the removal
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -5515,6 +5548,7 @@ void
 e_cal_client_remove_objects (ECalClient *client,
                              const GSList *ids,
                              ECalObjModType mod,
+                            guint32 opflags,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
@@ -5529,6 +5563,7 @@ e_cal_client_remove_objects (ECalClient *client,
        async_context->ids_list = g_slist_copy_deep (
                (GSList *) ids, (GCopyFunc) e_cal_component_id_copy, NULL);
        async_context->mod = mod;
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -5582,6 +5617,7 @@ e_cal_client_remove_objects_finish (ECalClient *client,
  * @ids: (element-type ECalComponentId): a list of #ECalComponentId objects
  *       identifying the objects to remove
  * @mod: Type of the removal
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: (allow-none): a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
@@ -5598,26 +5634,27 @@ gboolean
 e_cal_client_remove_objects_sync (ECalClient *client,
                                   const GSList *ids,
                                   ECalObjModType mod,
+                                 guint32 opflags,
                                   GCancellable *cancellable,
                                   GError **error)
 {
        GVariantBuilder builder;
        GFlagsClass *flags_class;
        GFlagsValue *flags_value;
-       GString *flags;
+       GString *mod_flags;
        guint n_valid_uids = 0;
        GError *local_error = NULL;
 
        g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
        g_return_val_if_fail (ids != NULL, FALSE);
 
-       flags = g_string_new (NULL);
+       mod_flags = g_string_new (NULL);
        flags_class = g_type_class_ref (E_TYPE_CAL_OBJ_MOD_TYPE);
        flags_value = g_flags_get_first_value (flags_class, mod);
        while (flags_value != NULL) {
-               if (flags->len > 0)
-                       g_string_append_c (flags, ':');
-               g_string_append (flags, flags_value->value_nick);
+               if (mod_flags->len > 0)
+                       g_string_append_c (mod_flags, ':');
+               g_string_append (mod_flags, flags_value->value_nick);
                mod &= ~flags_value->value;
                flags_value = g_flags_get_first_value (flags_class, mod);
        }
@@ -5668,13 +5705,13 @@ e_cal_client_remove_objects_sync (ECalClient *client,
                e_dbus_calendar_call_remove_objects_sync (
                        client->priv->dbus_proxy,
                        g_variant_builder_end (&builder),
-                       flags->str, cancellable, &local_error);
+                       mod_flags->str, opflags, cancellable, &local_error);
        } else {
                g_variant_builder_clear (&builder);
        }
 
        g_type_class_unref (flags_class);
-       g_string_free (flags, TRUE);
+       g_string_free (mod_flags, TRUE);
 
        if (local_error != NULL) {
                g_dbus_error_strip_remote_error (local_error);
@@ -5699,6 +5736,7 @@ cal_client_receive_objects_thread (GSimpleAsyncResult *simple,
        if (!e_cal_client_receive_objects_sync (
                E_CAL_CLIENT (source_object),
                async_context->in_comp,
+               async_context->opflags,
                cancellable, &local_error)) {
 
                if (!local_error)
@@ -5716,6 +5754,7 @@ cal_client_receive_objects_thread (GSimpleAsyncResult *simple,
  * e_cal_client_receive_objects:
  * @client: an #ECalClient
  * @icalcomp: An #ICalComponent
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -5732,6 +5771,7 @@ cal_client_receive_objects_thread (GSimpleAsyncResult *simple,
 void
 e_cal_client_receive_objects (ECalClient *client,
                               ICalComponent *icalcomp,
+                             guint32 opflags,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data)
@@ -5744,6 +5784,7 @@ e_cal_client_receive_objects (ECalClient *client,
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->in_comp = i_cal_component_new_clone (icalcomp);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -5795,6 +5836,7 @@ e_cal_client_receive_objects_finish (ECalClient *client,
  * e_cal_client_receive_objects_sync:
  * @client: an #ECalClient
  * @icalcomp: An #ICalComponent
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
@@ -5809,6 +5851,7 @@ e_cal_client_receive_objects_finish (ECalClient *client,
 gboolean
 e_cal_client_receive_objects_sync (ECalClient *client,
                                    ICalComponent *icalcomp,
+                                  guint32 opflags,
                                    GCancellable *cancellable,
                                    GError **error)
 {
@@ -5822,7 +5865,7 @@ e_cal_client_receive_objects_sync (ECalClient *client,
        utf8_ical_string = e_util_utf8_make_valid (ical_string);
 
        e_dbus_calendar_call_receive_objects_sync (
-               client->priv->dbus_proxy, utf8_ical_string,
+               client->priv->dbus_proxy, utf8_ical_string, opflags,
                cancellable, &local_error);
 
        g_free (utf8_ical_string);
@@ -5851,6 +5894,7 @@ cal_client_send_objects_thread (GSimpleAsyncResult *simple,
        if (!e_cal_client_send_objects_sync (
                E_CAL_CLIENT (source_object),
                async_context->in_comp,
+               async_context->opflags,
                &async_context->string_list,
                &async_context->out_comp,
                cancellable, &local_error)) {
@@ -5870,6 +5914,7 @@ cal_client_send_objects_thread (GSimpleAsyncResult *simple,
  * e_cal_client_send_objects:
  * @client: an #ECalClient
  * @icalcomp: An #ICalComponent to be sent
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -5884,6 +5929,7 @@ cal_client_send_objects_thread (GSimpleAsyncResult *simple,
 void
 e_cal_client_send_objects (ECalClient *client,
                            ICalComponent *icalcomp,
+                          guint32 opflags,
                            GCancellable *cancellable,
                            GAsyncReadyCallback callback,
                            gpointer user_data)
@@ -5896,6 +5942,7 @@ e_cal_client_send_objects (ECalClient *client,
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->in_comp = i_cal_component_new_clone (icalcomp);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -5972,6 +6019,7 @@ e_cal_client_send_objects_finish (ECalClient *client,
  * e_cal_client_send_objects_sync:
  * @client: an #ECalClient
  * @icalcomp: An #ICalComponent to be sent
+ * @opflags: bit-or of #ECalOperationFlags
  * @out_users: (out) (transfer full) (element-type utf8): List of users to send the
  *             @out_modified_icalcomp to
  * @out_modified_icalcomp: (out) (transfer full): Return value for the #ICalComponent to be sent
@@ -5992,6 +6040,7 @@ e_cal_client_send_objects_finish (ECalClient *client,
 gboolean
 e_cal_client_send_objects_sync (ECalClient *client,
                                 ICalComponent *icalcomp,
+                               guint32 opflags,
                                 GSList **out_users,
                                 ICalComponent **out_modified_icalcomp,
                                 GCancellable *cancellable,
@@ -6012,8 +6061,8 @@ e_cal_client_send_objects_sync (ECalClient *client,
        utf8_ical_string = e_util_utf8_make_valid (ical_string);
 
        e_dbus_calendar_call_send_objects_sync (
-               client->priv->dbus_proxy, utf8_ical_string, &users,
-               &out_ical_string, cancellable, &local_error);
+               client->priv->dbus_proxy, utf8_ical_string, opflags,
+               &users, &out_ical_string, cancellable, &local_error);
 
        g_free (utf8_ical_string);
        g_free (ical_string);
@@ -6277,6 +6326,7 @@ cal_client_discard_alarm_thread (GSimpleAsyncResult *simple,
                async_context->uid,
                async_context->rid,
                async_context->auid,
+               async_context->opflags,
                cancellable, &local_error)) {
 
                if (!local_error)
@@ -6296,6 +6346,7 @@ cal_client_discard_alarm_thread (GSimpleAsyncResult *simple,
  * @uid: Unique identifier for a calendar component
  * @rid: Recurrence identifier
  * @auid: Alarm identifier to discard
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @callback: callback to call when a result is ready
  * @user_data: user data for the @callback
@@ -6311,6 +6362,7 @@ e_cal_client_discard_alarm (ECalClient *client,
                             const gchar *uid,
                             const gchar *rid,
                             const gchar *auid,
+                           guint32 opflags,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
@@ -6327,6 +6379,7 @@ e_cal_client_discard_alarm (ECalClient *client,
        async_context->uid = g_strdup (uid);
        async_context->rid = g_strdup (rid);
        async_context->auid = g_strdup (auid);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (client), callback, user_data,
@@ -6380,6 +6433,7 @@ e_cal_client_discard_alarm_finish (ECalClient *client,
  * @uid: Unique identifier for a calendar component
  * @rid: Recurrence identifier
  * @auid: Alarm identifier to discard
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable; can be %NULL
  * @error: (out): a #GError to set an error, if any
  *
@@ -6394,6 +6448,7 @@ e_cal_client_discard_alarm_sync (ECalClient *client,
                                  const gchar *uid,
                                  const gchar *rid,
                                  const gchar *auid,
+                                guint32 opflags,
                                  GCancellable *cancellable,
                                  GError **error)
 {
@@ -6415,7 +6470,7 @@ e_cal_client_discard_alarm_sync (ECalClient *client,
 
        e_dbus_calendar_call_discard_alarm_sync (
                client->priv->dbus_proxy,
-               utf8_uid, utf8_rid, utf8_auid,
+               utf8_uid, utf8_rid, utf8_auid, opflags,
                cancellable, &local_error);
 
        g_free (utf8_uid);
diff --git a/src/calendar/libecal/e-cal-client.h b/src/calendar/libecal/e-cal-client.h
index ca7678922..c1b17d2ec 100644
--- a/src/calendar/libecal/e-cal-client.h
+++ b/src/calendar/libecal/e-cal-client.h
@@ -326,6 +326,7 @@ gboolean    e_cal_client_get_free_busy_sync (ECalClient *client,
                                                 GError **error);
 void           e_cal_client_create_object      (ECalClient *client,
                                                 ICalComponent *icalcomp,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -336,11 +337,13 @@ gboolean  e_cal_client_create_object_finish
                                                 GError **error);
 gboolean       e_cal_client_create_object_sync (ECalClient *client,
                                                 ICalComponent *icalcomp,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 gchar **out_uid,
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_create_objects     (ECalClient *client,
                                                 GSList *icalcomps, /* ICalComponent * */
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -352,12 +355,14 @@ gboolean  e_cal_client_create_objects_finish
 gboolean       e_cal_client_create_objects_sync
                                                (ECalClient *client,
                                                 GSList *icalcomps, /* ICalComponent * */
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **out_uids, /* gchar * */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_modify_object      (ECalClient *client,
                                                 ICalComponent *icalcomp,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -368,11 +373,13 @@ gboolean  e_cal_client_modify_object_finish
 gboolean       e_cal_client_modify_object_sync (ECalClient *client,
                                                 ICalComponent *icalcomp,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_modify_objects     (ECalClient *client,
                                                 GSList *icalcomps, /* ICalComponent * */
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -384,12 +391,14 @@ gboolean  e_cal_client_modify_objects_sync
                                                (ECalClient *client,
                                                 GSList *icalcomps, /* ICalComponent * */
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_remove_object      (ECalClient *client,
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -401,11 +410,13 @@ gboolean  e_cal_client_remove_object_sync (ECalClient *client,
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_remove_objects     (ECalClient *client,
                                                 const GSList *ids, /* ECalComponentId * */
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -417,10 +428,12 @@ gboolean  e_cal_client_remove_objects_sync
                                                (ECalClient *client,
                                                 const GSList *ids, /* ECalComponentId * */
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_receive_objects    (ECalClient *client,
                                                 ICalComponent *icalcomp,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -431,10 +444,12 @@ gboolean  e_cal_client_receive_objects_finish
 gboolean       e_cal_client_receive_objects_sync
                                                (ECalClient *client,
                                                 ICalComponent *icalcomp,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_send_objects       (ECalClient *client,
                                                 ICalComponent *icalcomp,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -446,6 +461,7 @@ gboolean    e_cal_client_send_objects_finish
                                                 GError **error);
 gboolean       e_cal_client_send_objects_sync  (ECalClient *client,
                                                 ICalComponent *icalcomp,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **out_users, /* gchar * */
                                                 ICalComponent **out_modified_icalcomp,
                                                 GCancellable *cancellable,
@@ -473,6 +489,7 @@ void                e_cal_client_discard_alarm      (ECalClient *client,
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 const gchar *auid,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -484,6 +501,7 @@ gboolean    e_cal_client_discard_alarm_sync (ECalClient *client,
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 const gchar *auid,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_client_get_view           (ECalClient *client,
diff --git a/src/calendar/libecal/e-cal-enums.h b/src/calendar/libecal/e-cal-enums.h
index d1ea0226d..18af5dd26 100644
--- a/src/calendar/libecal/e-cal-enums.h
+++ b/src/calendar/libecal/e-cal-enums.h
@@ -196,12 +196,45 @@ typedef enum {
  *
  * Since: 3.30
  **/
-typedef enum {
+typedef enum { /*< flags >*/
        E_CAL_RECUR_DESCRIBE_RECURRENCE_FLAG_NONE       = 0,
        E_CAL_RECUR_DESCRIBE_RECURRENCE_FLAG_PREFIXED   = (1 << 0),
        E_CAL_RECUR_DESCRIBE_RECURRENCE_FLAG_FALLBACK   = (1 << 1)
 } ECalRecurDescribeRecurrenceFlags;
 
+/**
+ * ECalOperationFlags:
+ * @E_CAL_OPERATION_FLAG_NONE: no operation flags defined
+ * @E_CAL_OPERATION_FLAG_CONFLICT_FAIL: conflict resolution mode, to fail and do not
+ *    do any changes, when a conflict is detected
+ * @E_CAL_OPERATION_FLAG_CONFLICT_USE_NEWER: conflict resolution mode, to use newer
+ *    of the local and the server side data, when a conflict is detected
+ * @E_CAL_OPERATION_FLAG_CONFLICT_KEEP_SERVER: conflict resolution mode, to use
+ *    the server data (and local changed), when a conflict is detected
+ * @E_CAL_OPERATION_FLAG_CONFLICT_KEEP_LOCAL: conflict resolution mode, to use
+ *    local data (and always overwrite server data), when a conflict is detected
+ * @E_CAL_OPERATION_FLAG_CONFLICT_WRITE_COPY: conflict resolution mode, to create
+ *    a copy of the data, when a conflict is detected
+ * @E_CAL_OPERATION_FLAG_DISABLE_ITIP_MESSAGE: request to disable send of an iTip
+ *    message by the server; this works only for servers which support iTip handling
+ *
+ * Calendar operation flags, to specify behavior in certain situations. The conflict
+ * resolution mode flags cannot be combined together, where the @E_CAL_OPERATION_FLAG_CONFLICT_KEEP_LOCAL
+ * is the default behavior (and it is used when no other conflict resolution flag is set).
+ * The flags can be ignored when the operation or the backend don't support it.
+ *
+ * Since: 3.36
+ **/
+typedef enum { /*< flags >*/
+       E_CAL_OPERATION_FLAG_NONE                       = 0,
+       E_CAL_OPERATION_FLAG_CONFLICT_FAIL              = (1 << 0),
+       E_CAL_OPERATION_FLAG_CONFLICT_USE_NEWER         = (1 << 1),
+       E_CAL_OPERATION_FLAG_CONFLICT_KEEP_SERVER       = (1 << 2),
+       E_CAL_OPERATION_FLAG_CONFLICT_KEEP_LOCAL        = 0,
+       E_CAL_OPERATION_FLAG_CONFLICT_WRITE_COPY        = (1 << 3),
+       E_CAL_OPERATION_FLAG_DISABLE_ITIP_MESSAGE       = (1 << 4)
+} ECalOperationFlags;
+
 G_END_DECLS
 
 #endif /* E_CAL_ENUMS_H */
diff --git a/src/calendar/libecal/e-cal-util.c b/src/calendar/libecal/e-cal-util.c
index 1d77fc297..45d515036 100644
--- a/src/calendar/libecal/e-cal-util.c
+++ b/src/calendar/libecal/e-cal-util.c
@@ -2557,3 +2557,59 @@ e_cal_util_mark_task_complete_sync (ICalComponent *vtodo,
 
        return TRUE;
 }
+
+/**
+ * e_cal_util_operation_flags_to_conflict_resolution:
+ * @flags: bit-or of #ECalOperationFlags
+ *
+ * Decodes the #EConflictResolution from the bit-or of #ECalOperationFlags.
+ *
+ * Returns: an #EConflictResolution as stored in the @flags
+ *
+ * Since: 3.36
+ **/
+EConflictResolution
+e_cal_util_operation_flags_to_conflict_resolution (guint32 flags)
+{
+       if ((flags & E_CAL_OPERATION_FLAG_CONFLICT_FAIL) != 0)
+               return E_CONFLICT_RESOLUTION_FAIL;
+       else if ((flags & E_CAL_OPERATION_FLAG_CONFLICT_USE_NEWER) != 0)
+               return E_CONFLICT_RESOLUTION_USE_NEWER;
+       else if ((flags & E_CAL_OPERATION_FLAG_CONFLICT_KEEP_SERVER) != 0)
+               return E_CONFLICT_RESOLUTION_KEEP_SERVER;
+       else if ((flags & E_CAL_OPERATION_FLAG_CONFLICT_WRITE_COPY) != 0)
+               return E_CONFLICT_RESOLUTION_WRITE_COPY;
+
+       /* E_CAL_OPERATION_FLAG_CONFLICT_KEEP_LOCAL is the default */
+       return E_CONFLICT_RESOLUTION_KEEP_LOCAL;
+}
+
+/**
+ * e_cal_util_conflict_resolution_to_operation_flags:
+ * @conflict_resolution: an #EConflictResolution
+ *
+ * Encodes the #EConflictResolution into the bit-or of #ECalOperationFlags.
+ * The returned value can be bit-or-ed into other #ECalOperationFlags value.
+ *
+ * Returns: a bit-or #ECalOperationFlags corresponding to the @conflict_resolution
+ *
+ * Since: 3.36
+ **/
+guint32
+e_cal_util_conflict_resolution_to_operation_flags (EConflictResolution conflict_resolution)
+{
+       switch (conflict_resolution) {
+       case E_CONFLICT_RESOLUTION_FAIL:
+               return E_CAL_OPERATION_FLAG_CONFLICT_FAIL;
+       case E_CONFLICT_RESOLUTION_USE_NEWER:
+               return E_CAL_OPERATION_FLAG_CONFLICT_USE_NEWER;
+       case E_CONFLICT_RESOLUTION_KEEP_SERVER:
+               return E_CAL_OPERATION_FLAG_CONFLICT_KEEP_SERVER;
+       case E_CONFLICT_RESOLUTION_KEEP_LOCAL:
+               return E_CAL_OPERATION_FLAG_CONFLICT_KEEP_LOCAL;
+       case E_CONFLICT_RESOLUTION_WRITE_COPY:
+               return E_CAL_OPERATION_FLAG_CONFLICT_WRITE_COPY;
+       }
+
+       return E_CAL_OPERATION_FLAG_CONFLICT_KEEP_LOCAL;
+}
diff --git a/src/calendar/libecal/e-cal-util.h b/src/calendar/libecal/e-cal-util.h
index ef5b4d151..1f77d31a4 100644
--- a/src/calendar/libecal/e-cal-util.h
+++ b/src/calendar/libecal/e-cal-util.h
@@ -26,6 +26,7 @@
 
 #include <libical-glib/libical-glib.h>
 #include <time.h>
+#include <libedataserver/libedataserver.h>
 #include <libecal/e-cal-component.h>
 #include <libecal/e-cal-recur.h>
 #include <libecal/e-cal-enums.h>
@@ -297,6 +298,11 @@ gboolean   e_cal_util_mark_task_complete_sync
                                                 struct _ECalClient *cal_client,
                                                 GCancellable *cancellable,
                                                 GError **error);
+EConflictResolution
+               e_cal_util_operation_flags_to_conflict_resolution
+                                               (guint32 flags); /* bit-or of ECalOperationFlags */
+guint32                e_cal_util_conflict_resolution_to_operation_flags /* bit-or of ECalOperationFlags */
+                                               (EConflictResolution conflict_resolution);
 
 G_END_DECLS
 
diff --git a/src/calendar/libecal/e-reminder-watcher.c b/src/calendar/libecal/e-reminder-watcher.c
index eb4b107f1..06d367883 100644
--- a/src/calendar/libecal/e-reminder-watcher.c
+++ b/src/calendar/libecal/e-reminder-watcher.c
@@ -3174,6 +3174,7 @@ e_reminder_watcher_dismiss_one_sync (ECalClient *client,
                        e_cal_component_id_get_uid (id),
                        e_cal_component_id_get_rid (id),
                        e_cal_component_alarm_instance_get_uid (rd->instance),
+                       E_CAL_OPERATION_FLAG_NONE,
                        cancellable, &local_error);
 
                e_reminder_watcher_debug_print ("Discard alarm for '%s' from %s (uid:%s rid:%s auid:%s) 
%s%s%s%s\n",
diff --git a/src/calendar/libedata-cal/e-cal-backend-sync.c b/src/calendar/libedata-cal/e-cal-backend-sync.c
index 46ee65fe7..8a823e662 100644
--- a/src/calendar/libedata-cal/e-cal-backend-sync.c
+++ b/src/calendar/libedata-cal/e-cal-backend-sync.c
@@ -241,6 +241,7 @@ e_cal_backend_sync_get_free_busy (ECalBackendSync *backend,
  * @cal: An EDataCal object.
  * @cancellable: a #GCancellable for the operation
  * @calobjs: The objects to be added.
+ * @opflags: bit-or of #ECalOperationFlags
  * @uids: Placeholder for server-generated UIDs.
  * @new_components: (out) (transfer full): Placeholder for returned #ECalComponent objects.
  * @error: Out parameter for a #GError.
@@ -254,6 +255,7 @@ e_cal_backend_sync_create_objects (ECalBackendSync *backend,
                                    EDataCal *cal,
                                    GCancellable *cancellable,
                                    const GSList *calobjs,
+                                  guint32 opflags,
                                    GSList **uids,
                                    GSList **new_components,
                                    GError **error)
@@ -268,7 +270,7 @@ e_cal_backend_sync_create_objects (ECalBackendSync *backend,
        if (class->create_objects_sync != NULL) {
                class->create_objects_sync (
                        backend, cal, cancellable,
-                       calobjs, uids, new_components, error);
+                       calobjs, opflags, uids, new_components, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -285,6 +287,7 @@ e_cal_backend_sync_create_objects (ECalBackendSync *backend,
  * @cancellable: a #GCancellable for the operation
  * @calobjs: Objects to be modified.
  * @mod: Type of modification to be done.
+ * @opflags: bit-or of #ECalOperationFlags
  * @old_components: (out) (transfer full): Placeholder for returning the old components as they were stored 
on the
  * backend.
  * @new_components: (out) (transfer full): Placeholder for returning the new components as they have been 
stored
@@ -301,6 +304,7 @@ e_cal_backend_sync_modify_objects (ECalBackendSync *backend,
                                    GCancellable *cancellable,
                                    const GSList *calobjs,
                                    ECalObjModType mod,
+                                  guint32 opflags,
                                    GSList **old_components,
                                    GSList **new_components,
                                    GError **error)
@@ -315,7 +319,7 @@ e_cal_backend_sync_modify_objects (ECalBackendSync *backend,
        if (class->modify_objects_sync != NULL) {
                class->modify_objects_sync (
                        backend, cal, cancellable,
-                       calobjs, mod, old_components, new_components, error);
+                       calobjs, mod, opflags, old_components, new_components, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -332,6 +336,7 @@ e_cal_backend_sync_modify_objects (ECalBackendSync *backend,
  * @cancellable: a #GCancellable for the operation
  * @ids: List of #ECalComponentId objects identifying the objects to remove.
  * @mod: Type of removal.
+ * @opflags: bit-or of #ECalOperationFlags
  * @old_components: (out) (transfer full): Placeholder for returning the old components as they were stored 
on the
  * backend.
  * @new_components: (out) (transfer full): Placeholder for returning the new components as they have been 
stored
@@ -349,6 +354,7 @@ e_cal_backend_sync_remove_objects (ECalBackendSync *backend,
                                    GCancellable *cancellable,
                                    const GSList *ids,
                                    ECalObjModType mod,
+                                  guint32 opflags,
                                    GSList **old_components,
                                    GSList **new_components,
                                    GError **error)
@@ -363,7 +369,7 @@ e_cal_backend_sync_remove_objects (ECalBackendSync *backend,
        if (class->remove_objects_sync != NULL) {
                class->remove_objects_sync (
                        backend, cal, cancellable,
-                       ids, mod, old_components, new_components, error);
+                       ids, mod, opflags, old_components, new_components, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -377,6 +383,7 @@ e_cal_backend_sync_remove_objects (ECalBackendSync *backend,
  * e_cal_backend_sync_receive_objects:
  * @backend: An ECalBackendSync object.
  * @cal: An EDataCal object.
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: a #GCancellable for the operation
  * @calobj: iCalendar object to receive.
  * @error: Out parameter for a #GError.
@@ -388,6 +395,7 @@ e_cal_backend_sync_receive_objects (ECalBackendSync *backend,
                                     EDataCal *cal,
                                     GCancellable *cancellable,
                                     const gchar *calobj,
+                                   guint32 opflags,
                                     GError **error)
 {
        ECalBackendSyncClass *class;
@@ -399,7 +407,7 @@ e_cal_backend_sync_receive_objects (ECalBackendSync *backend,
 
        if (class->receive_objects_sync != NULL) {
                class->receive_objects_sync (
-                       backend, cal, cancellable, calobj, error);
+                       backend, cal, cancellable, calobj, opflags, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -415,6 +423,7 @@ e_cal_backend_sync_receive_objects (ECalBackendSync *backend,
  * @cal: An EDataCal object.
  * @cancellable: a #GCancellable for the operation
  * @calobj: The iCalendar object to send.
+ * @opflags: bit-or of #ECalOperationFlags
  * @users: List of users to send notifications to.
  * @modified_calobj: Placeholder for the iCalendar object after being modified.
  * @error: Out parameter for a #GError.
@@ -426,6 +435,7 @@ e_cal_backend_sync_send_objects (ECalBackendSync *backend,
                                  EDataCal *cal,
                                  GCancellable *cancellable,
                                  const gchar *calobj,
+                                guint32 opflags,
                                  GSList **users,
                                  gchar **modified_calobj,
                                  GError **error)
@@ -440,7 +450,7 @@ e_cal_backend_sync_send_objects (ECalBackendSync *backend,
        if (class->send_objects_sync != NULL) {
                class->send_objects_sync (
                        backend, cal, cancellable,
-                       calobj, users, modified_calobj, error);
+                       calobj, opflags, users, modified_calobj, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -502,6 +512,7 @@ e_cal_backend_sync_get_attachment_uris (ECalBackendSync *backend,
  * @uid: Unique id of the calendar object.
  * @rid: Recurrence id of the calendar object.
  * @auid: Alarm ID to remove.
+ * @opflags: bit-or of #ECalOperationFlags
  * @error: Out parameter for a #GError.
  *
  * Calls the discard_alarm_sync method on the given backend.
@@ -513,6 +524,7 @@ e_cal_backend_sync_discard_alarm (ECalBackendSync *backend,
                                   const gchar *uid,
                                   const gchar *rid,
                                   const gchar *auid,
+                                 guint32 opflags,
                                   GError **error)
 {
        ECalBackendSyncClass *class;
@@ -527,7 +539,7 @@ e_cal_backend_sync_discard_alarm (ECalBackendSync *backend,
        if (class->discard_alarm_sync != NULL) {
                class->discard_alarm_sync (
                        backend, cal, cancellable,
-                       uid, rid, auid, error);
+                       uid, rid, auid, opflags, error);
        } else {
                g_set_error_literal (
                        error, E_CLIENT_ERROR,
@@ -740,13 +752,14 @@ cal_backend_create_objects (ECalBackend *backend,
                             EDataCal *cal,
                             guint32 opid,
                             GCancellable *cancellable,
-                            const GSList *calobjs)
+                            const GSList *calobjs,
+                           guint32 opflags)
 {
        GError *error = NULL;
        GSList *uids = NULL;
        GSList *new_components = NULL;
 
-       e_cal_backend_sync_create_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobjs, &uids, 
&new_components, &error);
+       e_cal_backend_sync_create_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobjs, opflags, 
&uids, &new_components, &error);
 
        if (!new_components)
                new_components = ecalcomponent_slist_from_strings (calobjs);
@@ -763,12 +776,13 @@ cal_backend_modify_objects (ECalBackend *backend,
                             guint32 opid,
                             GCancellable *cancellable,
                             const GSList *calobjs,
-                            ECalObjModType mod)
+                            ECalObjModType mod,
+                           guint32 opflags)
 {
        GError *error = NULL;
        GSList *old_components = NULL, *new_components = NULL;
 
-       e_cal_backend_sync_modify_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobjs, mod, 
&old_components, &new_components, &error);
+       e_cal_backend_sync_modify_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobjs, mod, 
opflags, &old_components, &new_components, &error);
 
        if (!old_components)
                old_components = ecalcomponent_slist_from_strings (calobjs);
@@ -785,12 +799,13 @@ cal_backend_remove_objects (ECalBackend *backend,
                             guint32 opid,
                             GCancellable *cancellable,
                             const GSList *ids,
-                            ECalObjModType mod)
+                            ECalObjModType mod,
+                           guint32 opflags)
 {
        GError *error = NULL;
        GSList *old_components = NULL, *new_components = NULL;
 
-       e_cal_backend_sync_remove_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, ids, mod, 
&old_components, &new_components, &error);
+       e_cal_backend_sync_remove_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, ids, mod, opflags, 
&old_components, &new_components, &error);
 
        e_data_cal_respond_remove_objects (cal, opid, error, ids, old_components, new_components);
 
@@ -803,11 +818,12 @@ cal_backend_receive_objects (ECalBackend *backend,
                              EDataCal *cal,
                              guint32 opid,
                              GCancellable *cancellable,
-                             const gchar *calobj)
+                             const gchar *calobj,
+                            guint32 opflags)
 {
        GError *error = NULL;
 
-       e_cal_backend_sync_receive_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobj, &error);
+       e_cal_backend_sync_receive_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobj, opflags, 
&error);
 
        e_data_cal_respond_receive_objects (cal, opid, error);
 }
@@ -817,13 +833,14 @@ cal_backend_send_objects (ECalBackend *backend,
                           EDataCal *cal,
                           guint32 opid,
                           GCancellable *cancellable,
-                          const gchar *calobj)
+                          const gchar *calobj,
+                         guint32 opflags)
 {
        GError *error = NULL;
        GSList *users = NULL;
        gchar *modified_calobj = NULL;
 
-       e_cal_backend_sync_send_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobj, &users, 
&modified_calobj, &error);
+       e_cal_backend_sync_send_objects (E_CAL_BACKEND_SYNC (backend), cal, cancellable, calobj, opflags, 
&users, &modified_calobj, &error);
 
        e_data_cal_respond_send_objects (cal, opid, error, users, modified_calobj ? modified_calobj : calobj);
 
@@ -858,11 +875,12 @@ cal_backend_discard_alarm (ECalBackend *backend,
                            GCancellable *cancellable,
                            const gchar *uid,
                            const gchar *rid,
-                           const gchar *auid)
+                           const gchar *auid,
+                          guint32 opflags)
 {
        GError *error = NULL;
 
-       e_cal_backend_sync_discard_alarm (E_CAL_BACKEND_SYNC (backend), cal, cancellable, uid, rid, auid, 
&error);
+       e_cal_backend_sync_discard_alarm (E_CAL_BACKEND_SYNC (backend), cal, cancellable, uid, rid, auid, 
opflags, &error);
 
        e_data_cal_respond_discard_alarm (cal, opid, error);
 }
diff --git a/src/calendar/libedata-cal/e-cal-backend-sync.h b/src/calendar/libedata-cal/e-cal-backend-sync.h
index 84ae1f76c..b0f8b85e1 100644
--- a/src/calendar/libedata-cal/e-cal-backend-sync.h
+++ b/src/calendar/libedata-cal/e-cal-backend-sync.h
@@ -122,6 +122,7 @@ struct _ECalBackendSyncClass {
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
                                                 const GSList *calobjs,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **uids,
                                                 GSList **new_components,
                                                 GError **error);
@@ -130,6 +131,7 @@ struct _ECalBackendSyncClass {
                                                 GCancellable *cancellable,
                                                 const GSList *calobjs,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **old_components,
                                                 GSList **new_components,
                                                 GError **error);
@@ -138,6 +140,7 @@ struct _ECalBackendSyncClass {
                                                 GCancellable *cancellable,
                                                 const GSList *ids,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **old_components,
                                                 GSList **new_components,
                                                 GError **error);
@@ -145,11 +148,13 @@ struct _ECalBackendSyncClass {
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GError **error);
        void            (*send_objects_sync)    (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **users,
                                                 gchar **modified_calobj,
                                                 GError **error);
@@ -167,6 +172,7 @@ struct _ECalBackendSyncClass {
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 const gchar *auid,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GError **error);
        void            (*get_timezone_sync)    (ECalBackendSync *backend,
                                                 EDataCal *cal,
@@ -222,6 +228,7 @@ void                e_cal_backend_sync_create_objects
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
                                                 const GSList *calobjs,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **uids,
                                                 GSList **new_components,
                                                 GError **error);
@@ -231,6 +238,7 @@ void                e_cal_backend_sync_modify_objects
                                                 GCancellable *cancellable,
                                                 const GSList *calobjs,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **old_components,
                                                 GSList **new_components,
                                                 GError **error);
@@ -240,6 +248,7 @@ void                e_cal_backend_sync_remove_objects
                                                 GCancellable *cancellable,
                                                 const GSList *ids,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **old_components,
                                                 GSList **new_components,
                                                 GError **error);
@@ -248,11 +257,13 @@ void              e_cal_backend_sync_receive_objects
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GError **error);
 void           e_cal_backend_sync_send_objects (ECalBackendSync *backend,
                                                 EDataCal *cal,
                                                 GCancellable *cancellable,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GSList **users,
                                                 gchar **modified_calobj,
                                                 GError **error);
@@ -271,6 +282,7 @@ void                e_cal_backend_sync_discard_alarm
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 const gchar *auid,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GError **error);
 void           e_cal_backend_sync_get_timezone (ECalBackendSync *backend,
                                                 EDataCal *cal,
diff --git a/src/calendar/libedata-cal/e-cal-backend.c b/src/calendar/libedata-cal/e-cal-backend.c
index 25e521cc0..0235e26ca 100644
--- a/src/calendar/libedata-cal/e-cal-backend.c
+++ b/src/calendar/libedata-cal/e-cal-backend.c
@@ -84,6 +84,7 @@ struct _AsyncContext {
        time_t end;
        GSList *compid_list;
        GSList *string_list;
+       guint32 opflags;
 
        /* Outputs */
        GQueue result_queue;
@@ -2470,6 +2471,7 @@ e_cal_backend_get_free_busy_finish (ECalBackend *backend,
  * e_cal_backend_create_objects_sync:
  * @backend: an #ECalBackend
  * @calobjs: a %NULL-terminated array of iCalendar strings
+ * @opflags: bit-or of #ECalOperationFlags
  * @out_uids: a #GQueue in which to deposit results
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
@@ -2488,6 +2490,7 @@ e_cal_backend_get_free_busy_finish (ECalBackend *backend,
 gboolean
 e_cal_backend_create_objects_sync (ECalBackend *backend,
                                    const gchar * const *calobjs,
+                                  guint32 opflags,
                                    GQueue *out_uids,
                                    GCancellable *cancellable,
                                    GError **error)
@@ -2502,7 +2505,7 @@ e_cal_backend_create_objects_sync (ECalBackend *backend,
        closure = e_async_closure_new ();
 
        e_cal_backend_create_objects (
-               backend, calobjs, cancellable,
+               backend, calobjs, opflags, cancellable,
                e_async_closure_callback, closure);
 
        result = e_async_closure_wait (closure);
@@ -2559,7 +2562,7 @@ cal_backend_create_objects_thread (GSimpleAsyncResult *simple,
 
                class->create_objects (
                        backend, data_cal, opid, cancellable,
-                       async_context->string_list);
+                       async_context->string_list, async_context->opflags);
        }
 
        g_object_unref (data_cal);
@@ -2569,6 +2572,7 @@ cal_backend_create_objects_thread (GSimpleAsyncResult *simple,
  * e_cal_backend_create_objects:
  * @backend: an #ECalBackend
  * @calobjs: a %NULL-terminated array of iCalendar strings
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @callback: a #GAsyncReadyCallback to call when the request is satisifed
  * @user_data: data to pass to the callback function
@@ -2584,6 +2588,7 @@ cal_backend_create_objects_thread (GSimpleAsyncResult *simple,
 void
 e_cal_backend_create_objects (ECalBackend *backend,
                               const gchar * const *calobjs,
+                             guint32 opflags,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data)
@@ -2601,6 +2606,7 @@ e_cal_backend_create_objects (ECalBackend *backend,
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->string_list = g_slist_reverse (list);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (backend), callback, user_data,
@@ -2696,6 +2702,7 @@ e_cal_backend_create_objects_finish (ECalBackend *backend,
  * @backend: an #ECalBackend
  * @calobjs: a %NULL-terminated array of iCalendar strings
  * @mod: modification type for recurrences
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
  *
@@ -2711,6 +2718,7 @@ gboolean
 e_cal_backend_modify_objects_sync (ECalBackend *backend,
                                    const gchar * const *calobjs,
                                    ECalObjModType mod,
+                                  guint32 opflags,
                                    GCancellable *cancellable,
                                    GError **error)
 {
@@ -2724,7 +2732,7 @@ e_cal_backend_modify_objects_sync (ECalBackend *backend,
        closure = e_async_closure_new ();
 
        e_cal_backend_modify_objects (
-               backend, calobjs, mod, cancellable,
+               backend, calobjs, mod, opflags, cancellable,
                e_async_closure_callback, closure);
 
        result = e_async_closure_wait (closure);
@@ -2782,7 +2790,8 @@ cal_backend_modify_objects_thread (GSimpleAsyncResult *simple,
                class->modify_objects (
                        backend, data_cal, opid, cancellable,
                        async_context->string_list,
-                       async_context->mod);
+                       async_context->mod,
+                       async_context->opflags);
        }
 
        g_object_unref (data_cal);
@@ -2793,6 +2802,7 @@ cal_backend_modify_objects_thread (GSimpleAsyncResult *simple,
  * @backend: an #ECalBackend
  * @calobjs: a %NULL-terminated array of iCalendar strings
  * @mod: modification type for recurrences
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: data to pass to the callback function
@@ -2810,6 +2820,7 @@ void
 e_cal_backend_modify_objects (ECalBackend *backend,
                               const gchar * const *calobjs,
                               ECalObjModType mod,
+                             guint32 opflags,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data)
@@ -2828,6 +2839,7 @@ e_cal_backend_modify_objects (ECalBackend *backend,
        async_context = g_slice_new0 (AsyncContext);
        async_context->string_list = g_slist_reverse (list);
        async_context->mod = mod;
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (backend), callback, user_data,
@@ -2929,6 +2941,7 @@ e_cal_backend_modify_objects_finish (ECalBackend *backend,
  * @backend: an #ECalBackend
  * @component_ids: (element-type ECalComponentId): a #GList of #ECalComponentId structs
  * @mod: modification type for recurrences
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
  *
@@ -2944,6 +2957,7 @@ gboolean
 e_cal_backend_remove_objects_sync (ECalBackend *backend,
                                    GList *component_ids,
                                    ECalObjModType mod,
+                                  guint32 opflags,
                                    GCancellable *cancellable,
                                    GError **error)
 {
@@ -2957,7 +2971,7 @@ e_cal_backend_remove_objects_sync (ECalBackend *backend,
        closure = e_async_closure_new ();
 
        e_cal_backend_remove_objects (
-               backend, component_ids, mod, cancellable,
+               backend, component_ids, mod, opflags, cancellable,
                e_async_closure_callback, closure);
 
        result = e_async_closure_wait (closure);
@@ -3008,7 +3022,8 @@ cal_backend_remove_objects_thread (GSimpleAsyncResult *simple,
                class->remove_objects (
                        backend, data_cal, opid, cancellable,
                        async_context->compid_list,
-                       async_context->mod);
+                       async_context->mod,
+                       async_context->opflags);
        }
 
        g_object_unref (data_cal);
@@ -3019,6 +3034,7 @@ cal_backend_remove_objects_thread (GSimpleAsyncResult *simple,
  * @backend: an #ECalBackend
  * @component_ids: (element-type ECalComponentId): a #GList of #ECalComponentId structs
  * @mod: modification type for recurrences
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: data to pass to the callback function
@@ -3036,6 +3052,7 @@ void
 e_cal_backend_remove_objects (ECalBackend *backend,
                               GList *component_ids,
                               ECalObjModType mod,
+                             guint32 opflags,
                               GCancellable *cancellable,
                               GAsyncReadyCallback callback,
                               gpointer user_data)
@@ -3056,6 +3073,7 @@ e_cal_backend_remove_objects (ECalBackend *backend,
        async_context = g_slice_new0 (AsyncContext);
        async_context->compid_list = g_slist_reverse (list);
        async_context->mod = mod;
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (backend), callback, user_data,
@@ -3168,6 +3186,7 @@ e_cal_backend_remove_objects_finish (ECalBackend *backend,
  * e_cal_backend_receive_objects_sync:
  * @backend: an #ECalBackend
  * @calobj: an iCalendar string
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
  *
@@ -3183,6 +3202,7 @@ e_cal_backend_remove_objects_finish (ECalBackend *backend,
 gboolean
 e_cal_backend_receive_objects_sync (ECalBackend *backend,
                                     const gchar *calobj,
+                                   guint32 opflags,
                                     GCancellable *cancellable,
                                     GError **error)
 {
@@ -3196,7 +3216,7 @@ e_cal_backend_receive_objects_sync (ECalBackend *backend,
        closure = e_async_closure_new ();
 
        e_cal_backend_receive_objects (
-               backend, calobj, cancellable,
+               backend, calobj, opflags, cancellable,
                e_async_closure_callback, closure);
 
        result = e_async_closure_wait (closure);
@@ -3246,7 +3266,8 @@ cal_backend_receive_objects_thread (GSimpleAsyncResult *simple,
 
                class->receive_objects (
                        backend, data_cal, opid, cancellable,
-                       async_context->calobj);
+                       async_context->calobj,
+                       async_context->opflags);
        }
 
        g_object_unref (data_cal);
@@ -3256,6 +3277,7 @@ cal_backend_receive_objects_thread (GSimpleAsyncResult *simple,
  * e_cal_backend_receive_objects:
  * @backend: an #ECalBackend
  * @calobj: an iCalendar string
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: data to pass to the callback function
@@ -3273,6 +3295,7 @@ cal_backend_receive_objects_thread (GSimpleAsyncResult *simple,
 void
 e_cal_backend_receive_objects (ECalBackend *backend,
                                const gchar *calobj,
+                              guint32 opflags,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data)
@@ -3285,6 +3308,7 @@ e_cal_backend_receive_objects (ECalBackend *backend,
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->calobj = g_strdup (calobj);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (backend), callback, user_data,
@@ -3342,6 +3366,7 @@ e_cal_backend_receive_objects_finish (ECalBackend *backend,
  * e_cal_backend_send_objects_sync:
  * @backend: an #ECalBackend
  * @calobj: an iCalendar string
+ * @opflags: bit-or of #ECalOperationFlags
  * @out_users: a #GQueue in which to deposit results
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
@@ -3362,6 +3387,7 @@ e_cal_backend_receive_objects_finish (ECalBackend *backend,
 gchar *
 e_cal_backend_send_objects_sync (ECalBackend *backend,
                                  const gchar *calobj,
+                                guint32 opflags,
                                  GQueue *out_users,
                                  GCancellable *cancellable,
                                  GError **error)
@@ -3376,7 +3402,7 @@ e_cal_backend_send_objects_sync (ECalBackend *backend,
        closure = e_async_closure_new ();
 
        e_cal_backend_send_objects (
-               backend, calobj, cancellable,
+               backend, calobj, opflags, cancellable,
                e_async_closure_callback, closure);
 
        result = e_async_closure_wait (closure);
@@ -3426,7 +3452,8 @@ cal_backend_send_objects_thread (GSimpleAsyncResult *simple,
 
                class->send_objects (
                        backend, data_cal, opid, cancellable,
-                       async_context->calobj);
+                       async_context->calobj,
+                       async_context->opflags);
        }
 
        g_object_unref (data_cal);
@@ -3436,6 +3463,7 @@ cal_backend_send_objects_thread (GSimpleAsyncResult *simple,
  * e_cal_backend_send_objects:
  * @backend: an #ECalBackend
  * @calobj: an iCalendar string
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: data to pass to the callback function
@@ -3451,6 +3479,7 @@ cal_backend_send_objects_thread (GSimpleAsyncResult *simple,
 void
 e_cal_backend_send_objects (ECalBackend *backend,
                             const gchar *calobj,
+                           guint32 opflags,
                             GCancellable *cancellable,
                             GAsyncReadyCallback callback,
                             gpointer user_data)
@@ -3463,6 +3492,7 @@ e_cal_backend_send_objects (ECalBackend *backend,
 
        async_context = g_slice_new0 (AsyncContext);
        async_context->calobj = g_strdup (calobj);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (backend), callback, user_data,
@@ -3739,6 +3769,7 @@ e_cal_backend_get_attachment_uris_finish (ECalBackend *backend,
  * @uid: a unique ID for an iCalendar object
  * @rid: a recurrence ID, or %NULL
  * @alarm_uid: a unique ID for an iCalendar VALARM object
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
  *
@@ -3756,6 +3787,7 @@ e_cal_backend_discard_alarm_sync (ECalBackend *backend,
                                   const gchar *uid,
                                   const gchar *rid,
                                   const gchar *alarm_uid,
+                                 guint32 opflags,
                                   GCancellable *cancellable,
                                   GError **error)
 {
@@ -3771,7 +3803,7 @@ e_cal_backend_discard_alarm_sync (ECalBackend *backend,
        closure = e_async_closure_new ();
 
        e_cal_backend_discard_alarm (
-               backend, uid, rid, alarm_uid, cancellable,
+               backend, uid, rid, alarm_uid, opflags, cancellable,
                e_async_closure_callback, closure);
 
        result = e_async_closure_wait (closure);
@@ -3830,7 +3862,8 @@ cal_backend_discard_alarm_thread (GSimpleAsyncResult *simple,
                        backend, data_cal, opid, cancellable,
                        async_context->uid,
                        async_context->rid,
-                       async_context->alarm_uid);
+                       async_context->alarm_uid,
+                       async_context->opflags);
        }
 
        g_object_unref (data_cal);
@@ -3842,6 +3875,7 @@ cal_backend_discard_alarm_thread (GSimpleAsyncResult *simple,
  * @uid: a unique ID for an iCalendar object
  * @rid: a recurrence ID, or %NULL
  * @alarm_uid: a unique ID for an iCalendar VALARM object
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @callback: a #GAsyncReadyCallback to call when the request is satisfied
  * @user_data: data to pass to the callback function
@@ -3860,6 +3894,7 @@ e_cal_backend_discard_alarm (ECalBackend *backend,
                              const gchar *uid,
                              const gchar *rid,
                              const gchar *alarm_uid,
+                            guint32 opflags,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data)
@@ -3876,6 +3911,7 @@ e_cal_backend_discard_alarm (ECalBackend *backend,
        async_context->uid = g_strdup (uid);
        async_context->rid = g_strdup (rid);
        async_context->alarm_uid = g_strdup (alarm_uid);
+       async_context->opflags = opflags;
 
        simple = g_simple_async_result_new (
                G_OBJECT (backend), callback, user_data,
diff --git a/src/calendar/libedata-cal/e-cal-backend.h b/src/calendar/libedata-cal/e-cal-backend.h
index b732e20f3..3423b1d10 100644
--- a/src/calendar/libedata-cal/e-cal-backend.h
+++ b/src/calendar/libedata-cal/e-cal-backend.h
@@ -142,29 +142,34 @@ struct _ECalBackendClass {
                                                 EDataCal *cal,
                                                 guint32 opid,
                                                 GCancellable *cancellable,
-                                                const GSList *calobjs); /* gchar * */
+                                                const GSList *calobjs, /* gchar * */
+                                                guint32 opflags); /* bit-or of ECalOperationFlags */
        void            (*modify_objects)       (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
                                                 GCancellable *cancellable,
                                                 const GSList *calobjs, /* gchar * */
-                                                ECalObjModType mod);
+                                                ECalObjModType mod,
+                                                guint32 opflags); /* bit-or of ECalOperationFlags */
        void            (*remove_objects)       (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
                                                 GCancellable *cancellable,
                                                 const GSList *ids, /* ECalComponentId * */
-                                                ECalObjModType mod);
+                                                ECalObjModType mod,
+                                                guint32 opflags); /* bit-or of ECalOperationFlags */
        void            (*receive_objects)      (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
                                                 GCancellable *cancellable,
-                                                const gchar *calobj);
+                                                const gchar *calobj,
+                                                guint32 opflags); /* bit-or of ECalOperationFlags */
        void            (*send_objects)         (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
                                                 GCancellable *cancellable,
-                                                const gchar *calobj);
+                                                const gchar *calobj,
+                                                guint32 opflags); /* bit-or of ECalOperationFlags */
        void            (*get_attachment_uris)  (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
@@ -177,7 +182,8 @@ struct _ECalBackendClass {
                                                 GCancellable *cancellable,
                                                 const gchar *uid,
                                                 const gchar *rid,
-                                                const gchar *auid);
+                                                const gchar *auid,
+                                                guint32 opflags); /* bit-or of ECalOperationFlags */
        void            (*get_timezone)         (ECalBackend *backend,
                                                 EDataCal *cal,
                                                 guint32 opid,
@@ -312,11 +318,13 @@ gboolean  e_cal_backend_get_free_busy_finish
 gboolean       e_cal_backend_create_objects_sync
                                                (ECalBackend *backend,
                                                 const gchar * const *calobjs,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GQueue *out_uids,
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_backend_create_objects    (ECalBackend *backend,
                                                 const gchar * const *calobjs,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -329,11 +337,13 @@ gboolean  e_cal_backend_modify_objects_sync
                                                (ECalBackend *backend,
                                                 const gchar * const *calobjs,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_backend_modify_objects    (ECalBackend *backend,
                                                 const gchar * const *calobjs,
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -345,11 +355,13 @@ gboolean  e_cal_backend_remove_objects_sync
                                                (ECalBackend *backend,
                                                 GList *component_ids, /* ECalComponentId * */
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_backend_remove_objects    (ECalBackend *backend,
                                                 GList *component_ids, /* ECalComponentId * */
                                                 ECalObjModType mod,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -360,10 +372,12 @@ gboolean  e_cal_backend_remove_objects_finish
 gboolean       e_cal_backend_receive_objects_sync
                                                (ECalBackend *backend,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_backend_receive_objects   (ECalBackend *backend,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -373,11 +387,13 @@ gboolean  e_cal_backend_receive_objects_finish
                                                 GError **error);
 gchar *                e_cal_backend_send_objects_sync (ECalBackend *backend,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GQueue *out_users,
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_backend_send_objects      (ECalBackend *backend,
                                                 const gchar *calobj,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
@@ -410,12 +426,14 @@ gboolean  e_cal_backend_discard_alarm_sync
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 const gchar *alarm_uid,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 void           e_cal_backend_discard_alarm     (ECalBackend *backend,
                                                 const gchar *uid,
                                                 const gchar *rid,
                                                 const gchar *alarm_uid,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GAsyncReadyCallback callback,
                                                 gpointer user_data);
diff --git a/src/calendar/libedata-cal/e-cal-cache.c b/src/calendar/libedata-cal/e-cal-cache.c
index 0caf051d4..670e20e3c 100644
--- a/src/calendar/libedata-cal/e-cal-cache.c
+++ b/src/calendar/libedata-cal/e-cal-cache.c
@@ -66,6 +66,7 @@
 #define ECC_COLUMN_HAS_START           "has_start"
 #define ECC_COLUMN_HAS_RECURRENCES     "has_recurrences"
 #define ECC_COLUMN_EXTRA               "bdata"
+#define ECC_COLUMN_CUSTOM_FLAGS                "custom_flags"
 
 struct _ECalCachePrivate {
        gboolean initializing;
@@ -397,6 +398,26 @@ e_cal_cache_get_strings (ECache *cache,
        return TRUE;
 }
 
+static gboolean
+e_cal_cache_get_uint64_cb (ECache *cache,
+                          gint ncols,
+                          const gchar **column_names,
+                          const gchar **column_values,
+                          gpointer user_data)
+{
+       guint64 *pui64 = user_data;
+
+       g_return_val_if_fail (pui64 != NULL, FALSE);
+
+       if (ncols == 1) {
+               *pui64 = column_values[0] ? g_ascii_strtoull (column_values[0], NULL, 10) : 0;
+       } else {
+               *pui64 = 0;
+       }
+
+       return TRUE;
+}
+
 static void
 e_cal_cache_populate_other_columns (ECalCache *cal_cache,
                                    GSList **out_other_columns)
@@ -429,6 +450,7 @@ e_cal_cache_populate_other_columns (ECalCache *cal_cache,
        add_column (ECC_COLUMN_HAS_START, "INTEGER", NULL);
        add_column (ECC_COLUMN_HAS_RECURRENCES, "INTEGER", NULL);
        add_column (ECC_COLUMN_EXTRA, "TEXT", NULL);
+       add_column (ECC_COLUMN_CUSTOM_FLAGS, "INTEGER", NULL);
 
        #undef add_column
 
@@ -1636,6 +1658,7 @@ ecc_convert_sexp_to_sql (ECalCache *cal_cache,
 
 typedef struct {
        gint extra_idx;
+       gint custom_flags_idx;
        ECalCacheSearchFunc func;
        gpointer func_user_data;
 } SearchContext;
@@ -1653,29 +1676,36 @@ ecc_search_foreach_cb (ECache *cache,
 {
        SearchContext *ctx = user_data;
        gchar *comp_uid = NULL, *comp_rid = NULL;
+       guint32 custom_flags = 0;
        gboolean can_continue;
 
        g_return_val_if_fail (ctx != NULL, FALSE);
        g_return_val_if_fail (ctx->func != NULL, FALSE);
 
-       if (ctx->extra_idx == -1) {
+       if (ctx->extra_idx == -1 || ctx->custom_flags_idx == -1) {
                gint ii;
 
-               for (ii = 0; ii < ncols; ii++) {
-                       if (column_names[ii] && g_ascii_strcasecmp (column_names[ii], ECC_COLUMN_EXTRA) == 0) 
{
-                               ctx->extra_idx = ii;
-                               break;
+               for (ii = 0; ii < ncols && (ctx->extra_idx == -1 || ctx->custom_flags_idx == -1); ii++) {
+                       if (column_names[ii]) {
+                               if (g_ascii_strcasecmp (column_names[ii], ECC_COLUMN_EXTRA) == 0)
+                                       ctx->extra_idx = ii;
+                               else if (g_ascii_strcasecmp (column_names[ii], ECC_COLUMN_CUSTOM_FLAGS) == 0)
+                                       ctx->custom_flags_idx = ii;
                        }
                }
        }
 
        g_return_val_if_fail (ctx->extra_idx != -1, FALSE);
+       g_return_val_if_fail (ctx->custom_flags_idx != -1, FALSE);
 
        g_warn_if_fail (ecc_decode_id_sql (uid, &comp_uid, &comp_rid));
 
+       if (ctx->custom_flags_idx >= 0 && column_values[ctx->custom_flags_idx])
+               custom_flags = g_ascii_strtoull (column_values[ctx->custom_flags_idx], NULL, 10);
+
        /* This type-cast for performance reason */
        can_continue = ctx->func ((ECalCache *) cache, comp_uid, comp_rid, revision, object,
-               column_values[ctx->extra_idx], offline_state, ctx->func_user_data);
+               column_values[ctx->extra_idx], custom_flags, offline_state, ctx->func_user_data);
 
        g_free (comp_uid);
        g_free (comp_rid);
@@ -1701,6 +1731,7 @@ ecc_search_internal (ECalCache *cal_cache,
        }
 
        ctx.extra_idx = -1;
+       ctx.custom_flags_idx = -1;
        ctx.func = func;
        ctx.func_user_data = user_data;
 
@@ -1775,8 +1806,10 @@ ecc_init_sqlite_functions (ECalCache *cal_cache,
 typedef struct _ComponentInfo {
        GSList *online_comps; /* ECalComponent * */
        GSList *online_extras; /* gchar * */
+       GSList *online_custom_flags; /* guint32 */
        GSList *offline_comps; /* ECalComponent * */
        GSList *offline_extras; /* gchar * */
+       GSList *offline_custom_flags; /* guint32 */
 } ComponentInfo;
 
 static void
@@ -1785,8 +1818,10 @@ component_info_clear (ComponentInfo *ci)
        if (ci) {
                g_slist_free_full (ci->online_comps, g_object_unref);
                g_slist_free_full (ci->online_extras, g_free);
+               g_slist_free (ci->online_custom_flags);
                g_slist_free_full (ci->offline_comps, g_object_unref);
                g_slist_free_full (ci->offline_extras, g_free);
+               g_slist_free (ci->offline_custom_flags);
        }
 }
 
@@ -1797,6 +1832,7 @@ cal_cache_gather_v1_affected_cb (ECalCache *cal_cache,
                                 const gchar *revision,
                                 const gchar *object,
                                 const gchar *extra,
+                                guint32 custom_flags,
                                 EOfflineState offline_state,
                                 gpointer user_data)
 {
@@ -1819,18 +1855,21 @@ cal_cache_gather_v1_affected_cb (ECalCache *cal_cache,
        if (dt && e_cal_component_datetime_get_value (dt) &&
            !i_cal_time_is_utc (e_cal_component_datetime_get_value (dt)) &&
            !e_cal_component_datetime_get_tzid (dt)) {
-               GSList **pcomps, **pextras;
+               GSList **pcomps, **pextras, **pcustom_flags;
 
                if (offline_state == E_OFFLINE_STATE_SYNCED) {
                        pcomps = &ci->online_comps;
                        pextras = &ci->online_extras;
+                       pcustom_flags = &ci->online_custom_flags;
                } else {
                        pcomps = &ci->offline_comps;
                        pextras = &ci->offline_extras;
+                       pcustom_flags = &ci->offline_custom_flags;
                }
 
                *pcomps = g_slist_prepend (*pcomps, g_object_ref (comp));
                *pextras = g_slist_prepend (*pextras, g_strdup (extra));
+               *pcustom_flags = g_slist_prepend (*pcustom_flags, GUINT_TO_POINTER (custom_flags));
        }
 
        e_cal_component_datetime_free (dt);
@@ -2096,6 +2135,7 @@ cal_cache_count_tmd_refs (ECalCache *cal_cache,
                          const gchar *revision,
                          const gchar *object,
                          const gchar *extra,
+                         guint32 custom_flags,
                          EOfflineState offline_state,
                          gpointer user_data)
 {
@@ -2190,10 +2230,10 @@ e_cal_cache_migrate (ECache *cache,
                        gboolean success = TRUE;
 
                        if (ci.online_comps)
-                               success = e_cal_cache_put_components (cal_cache, ci.online_comps, 
ci.online_extras, E_CACHE_IS_ONLINE, cancellable, NULL);
+                               success = e_cal_cache_put_components (cal_cache, ci.online_comps, 
ci.online_extras, ci.online_custom_flags, E_CACHE_IS_ONLINE, cancellable, NULL);
 
                        if (success && ci.offline_comps)
-                               e_cal_cache_put_components (cal_cache, ci.offline_comps, ci.offline_extras, 
E_CACHE_IS_OFFLINE, cancellable, NULL);
+                               e_cal_cache_put_components (cal_cache, ci.offline_comps, ci.offline_extras, 
ci.offline_custom_flags, E_CACHE_IS_OFFLINE, cancellable, NULL);
                }
 
                component_info_clear (&ci);
@@ -2381,6 +2421,7 @@ e_cal_cache_contains (ECalCache *cal_cache,
  * @cal_cache: an #ECalCache
  * @component: an #ECalComponent to put into the @cal_cache
  * @extra: (nullable): an extra data to store in association with the @component
+ * @custom_flags: custom flags for the @component, not interpreted by the @cal_cache
  * @offline_flag: one of #ECacheOfflineFlag, whether putting this component in offline
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
@@ -2396,12 +2437,14 @@ gboolean
 e_cal_cache_put_component (ECalCache *cal_cache,
                           ECalComponent *component,
                           const gchar *extra,
+                          guint32 custom_flags,
                           ECacheOfflineFlag offline_flag,
                           GCancellable *cancellable,
                           GError **error)
 {
        GSList *components = NULL;
        GSList *extras = NULL;
+       GSList *custom_flags_lst = NULL;
        gboolean success;
 
        g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
@@ -2409,9 +2452,11 @@ e_cal_cache_put_component (ECalCache *cal_cache,
        components = g_slist_prepend (components, component);
        if (extra)
                extras = g_slist_prepend (extras, (gpointer) extra);
+       custom_flags_lst = g_slist_prepend (custom_flags_lst, GUINT_TO_POINTER (custom_flags));
 
-       success = e_cal_cache_put_components (cal_cache, components, extras, offline_flag, cancellable, 
error);
+       success = e_cal_cache_put_components (cal_cache, components, extras, custom_flags_lst, offline_flag, 
cancellable, error);
 
+       g_slist_free (custom_flags_lst);
        g_slist_free (components);
        g_slist_free (extras);
 
@@ -2422,7 +2467,8 @@ e_cal_cache_put_component (ECalCache *cal_cache,
  * e_cal_cache_put_components:
  * @cal_cache: an #ECalCache
  * @components: (element-type ECalComponent): a #GSList of #ECalComponent to put into the @cal_cache
- * @extras: (nullable) (element-type utf8): an extra data to store in association with the @components
+ * @extras: (nullable) (element-type utf8): optional extra data to store in association with the @components
+ * @custom_flags: (nullable) (element-type guint32): optional custom flags to use for the @components
  * @offline_flag: one of #ECacheOfflineFlag, whether putting these components in offline
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
@@ -2430,8 +2476,9 @@ e_cal_cache_put_component (ECalCache *cal_cache,
  * Adds a list of @components into the @cal_cache. Any existing with the same UID
  * and RID are replaced.
  *
- * If @extras is not %NULL, it's length should be the same as the length
- * of the @components.
+ * If @extras is not %NULL, its length should be the same as the length
+ * of the @components. Similarly the non-NULL @custom_flags length
+ * should be the same as the length of the @components.
  *
  * Returns: Whether succeeded.
  *
@@ -2441,17 +2488,19 @@ gboolean
 e_cal_cache_put_components (ECalCache *cal_cache,
                            const GSList *components,
                            const GSList *extras,
+                           const GSList *custom_flags,
                            ECacheOfflineFlag offline_flag,
                            GCancellable *cancellable,
                            GError **error)
 {
-       const GSList *clink, *elink;
+       const GSList *clink, *elink, *flink;
        ECache *cache;
        ECacheColumnValues *other_columns;
        gboolean success = TRUE;
 
        g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
        g_return_val_if_fail (extras == NULL || g_slist_length ((GSList *) components) == g_slist_length 
((GSList *) extras), FALSE);
+       g_return_val_if_fail (custom_flags == NULL || g_slist_length ((GSList *) components) == 
g_slist_length ((GSList *) custom_flags), FALSE);
 
        cache = E_CACHE (cal_cache);
        other_columns = e_cache_column_values_new ();
@@ -2459,9 +2508,12 @@ e_cal_cache_put_components (ECalCache *cal_cache,
        e_cache_lock (cache, E_CACHE_LOCK_WRITE);
        e_cache_freeze_revision_change (cache);
 
-       for (clink = components, elink = extras; clink; clink = g_slist_next (clink), elink = g_slist_next 
(elink)) {
+       for (clink = components, elink = extras, flink = custom_flags;
+            clink;
+            (clink = g_slist_next (clink)), (elink = g_slist_next (elink)), (flink = g_slist_next (flink))) {
                ECalComponent *component = clink->data;
                const gchar *extra = elink ? elink->data : NULL;
+               guint32 custom_flags_val = flink ? GPOINTER_TO_UINT (flink->data) : 0;
                ECalComponentId *id;
                gchar *uid, *rev, *icalstring;
 
@@ -2474,6 +2526,7 @@ e_cal_cache_put_components (ECalCache *cal_cache,
 
                if (extra)
                        e_cache_column_values_take_value (other_columns, ECC_COLUMN_EXTRA, g_strdup (extra));
+               e_cache_column_values_take_value (other_columns, ECC_COLUMN_CUSTOM_FLAGS, g_strdup_printf 
("%u", custom_flags_val));
 
                id = e_cal_component_get_id (component);
                if (id) {
@@ -2509,6 +2562,7 @@ e_cal_cache_put_components (ECalCache *cal_cache,
  * @cal_cache: an #ECalCache
  * @uid: a UID of the component to remove
  * @rid: (nullable): an optional Recurrence-ID to remove
+ * @custom_flags: custom flags for the @component, not interpreted by the @cal_cache
  * @offline_flag: one of #ECacheOfflineFlag, whether removing this component in offline
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
@@ -2525,12 +2579,14 @@ gboolean
 e_cal_cache_remove_component (ECalCache *cal_cache,
                              const gchar *uid,
                              const gchar *rid,
+                             guint32 custom_flags,
                              ECacheOfflineFlag offline_flag,
                              GCancellable *cancellable,
                              GError **error)
 {
        ECalComponentId *id;
        GSList *ids = NULL;
+       GSList *custom_flags_lst = NULL;
        gboolean success;
 
        g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
@@ -2538,10 +2594,12 @@ e_cal_cache_remove_component (ECalCache *cal_cache,
        id = e_cal_component_id_new (uid, rid);
 
        ids = g_slist_prepend (ids, id);
+       custom_flags_lst = g_slist_prepend (custom_flags_lst, GUINT_TO_POINTER (custom_flags));
 
-       success = e_cal_cache_remove_components (cal_cache, ids, offline_flag, cancellable, error);
+       success = e_cal_cache_remove_components (cal_cache, ids, custom_flags_lst, offline_flag, cancellable, 
error);
 
        g_slist_free_full (ids, e_cal_component_id_free);
+       g_slist_free (custom_flags_lst);
 
        return success;
 }
@@ -2550,6 +2608,7 @@ e_cal_cache_remove_component (ECalCache *cal_cache,
  * e_cal_cache_remove_components:
  * @cal_cache: an #ECalCache
  * @ids: (element-type ECalComponentId): a #GSList of components to remove
+ * @custom_flags: (element-type guint32) (nullable): an optional #GSList of custom flags for the @ids
  * @offline_flag: one of #ECacheOfflineFlag, whether removing these comonents in offline
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
@@ -2557,6 +2616,9 @@ e_cal_cache_remove_component (ECalCache *cal_cache,
  * Removes components identified by @uid and @rid from the @cal_cache
  * in the @ids list. When the @rid is %NULL, or an empty string, then
  * removes the master object only, without any detached instance.
+ * The @custom_flags is used, if not %NULL, only if the @offline_flag
+ * is %E_CACHE_IS_OFFLINE. Otherwise it's ignored. The length of
+ * the @custom_flags should match the length of @ids, when not %NULL.
  *
  * Returns: Whether succeeded.
  *
@@ -2565,23 +2627,26 @@ e_cal_cache_remove_component (ECalCache *cal_cache,
 gboolean
 e_cal_cache_remove_components (ECalCache *cal_cache,
                               const GSList *ids,
+                              const GSList *custom_flags,
                               ECacheOfflineFlag offline_flag,
                               GCancellable *cancellable,
                               GError **error)
 {
        ECache *cache;
-       const GSList *link;
+       const GSList *link, *flink;
        gboolean success = TRUE;
 
        g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
+       g_return_val_if_fail (custom_flags == NULL || g_slist_length ((GSList *) ids) == g_slist_length 
((GSList *) custom_flags), FALSE);
 
        cache = E_CACHE (cal_cache);
 
        e_cache_lock (cache, E_CACHE_LOCK_WRITE);
        e_cache_freeze_revision_change (cache);
 
-       for (link = ids; success && link; link = g_slist_next (link)) {
+       for (link = ids, flink = custom_flags; success && link; (link = g_slist_next (link)), (flink = 
g_slist_next (flink))) {
                const ECalComponentId *id = link->data;
+               guint32 custom_flags_val = flink ? GPOINTER_TO_UINT (flink->data) : 0;
                gchar *uid;
 
                g_warn_if_fail (id != NULL);
@@ -2589,6 +2654,16 @@ e_cal_cache_remove_components (ECalCache *cal_cache,
                if (!id)
                        continue;
 
+               if (offline_flag == E_CACHE_IS_OFFLINE && flink) {
+                       success = e_cal_cache_set_component_custom_flags (cal_cache,
+                               e_cal_component_id_get_uid (id),
+                               e_cal_component_id_get_rid (id),
+                               custom_flags_val, cancellable, error);
+
+                       if (!success)
+                               break;
+               }
+
                uid = ecc_encode_id_sql (e_cal_component_id_get_uid (id), e_cal_component_id_get_rid (id));
 
                success = e_cache_remove (cache, uid, offline_flag, cancellable, error);
@@ -2683,6 +2758,123 @@ e_cal_cache_get_component_as_string (ECalCache *cal_cache,
        return *out_icalstring != NULL;
 }
 
+/**
+ * e_cal_cache_set_component_custom_flags:
+ * @cal_cache: an #ECalCache
+ * @uid: a UID of the component
+ * @rid: (nullable): an optional Recurrence-ID
+ * @custom_flags: the custom flags to set for the component
+ * @cancellable: optional #GCancellable object, or %NULL
+ * @error: return location for a #GError, or %NULL
+ *
+ * Sets or replaces the custom flags associated with a component
+ * identified by @uid and optionally @rid.
+ *
+ * Returns: Whether succeeded.
+ *
+ * Since: 3.36
+ **/
+gboolean
+e_cal_cache_set_component_custom_flags (ECalCache *cal_cache,
+                                       const gchar *uid,
+                                       const gchar *rid,
+                                       guint32 custom_flags,
+                                       GCancellable *cancellable,
+                                       GError **error)
+{
+       gchar *id, *stmt;
+       gboolean success;
+
+       g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
+       g_return_val_if_fail (uid != NULL, FALSE);
+
+       id = ecc_encode_id_sql (uid, rid);
+
+       if (!e_cache_contains (E_CACHE (cal_cache), id, E_CACHE_INCLUDE_DELETED)) {
+               g_free (id);
+
+               if (rid && *rid)
+                       g_set_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND, _("Object “%s”, “%s” not 
found"), uid, rid);
+               else
+                       g_set_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND, _("Object “%s” not 
found"), uid);
+
+               return FALSE;
+       }
+
+       stmt = e_cache_sqlite_stmt_printf (
+               "UPDATE " E_CACHE_TABLE_OBJECTS " SET " ECC_COLUMN_CUSTOM_FLAGS "=%u"
+               " WHERE " E_CACHE_COLUMN_UID "=%Q",
+               custom_flags, id);
+
+       success = e_cache_sqlite_exec (E_CACHE (cal_cache), stmt, cancellable, error);
+
+       e_cache_sqlite_stmt_free (stmt);
+       g_free (id);
+
+       return success;
+}
+
+/**
+ * e_cal_cache_get_component_custom_flags:
+ * @cal_cache: an #ECalCache
+ * @uid: a UID of the component
+ * @rid: (nullable): an optional Recurrence-ID
+ * @out_custom_flags: (out): return location to store the custom flags
+ * @cancellable: optional #GCancellable object, or %NULL
+ * @error: return location for a #GError, or %NULL
+ *
+ * Gets the custom flags previously set for @uid and @rid, either with
+ * e_cal_cache_set_component_custom_flags(), when adding components or
+ * when removing components in offline.
+ *
+ * Returns: Whether succeeded.
+ *
+ * Since: 3.36
+ **/
+gboolean
+e_cal_cache_get_component_custom_flags (ECalCache *cal_cache,
+                                       const gchar *uid,
+                                       const gchar *rid,
+                                       guint32 *out_custom_flags,
+                                       GCancellable *cancellable,
+                                       GError **error)
+{
+       gchar *id, *stmt;
+       guint64 value = 0;
+       gboolean success;
+
+       g_return_val_if_fail (E_IS_CAL_CACHE (cal_cache), FALSE);
+       g_return_val_if_fail (uid != NULL, FALSE);
+
+       id = ecc_encode_id_sql (uid, rid);
+
+       if (!e_cache_contains (E_CACHE (cal_cache), id, E_CACHE_INCLUDE_DELETED)) {
+               g_free (id);
+
+               if (rid && *rid)
+                       g_set_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND, _("Object “%s”, “%s” not 
found"), uid, rid);
+               else
+                       g_set_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND, _("Object “%s” not 
found"), uid);
+
+               return FALSE;
+       }
+
+       stmt = e_cache_sqlite_stmt_printf (
+               "SELECT " ECC_COLUMN_CUSTOM_FLAGS " FROM " E_CACHE_TABLE_OBJECTS
+               " WHERE " E_CACHE_COLUMN_UID "=%Q",
+               id);
+
+       success = e_cache_sqlite_select (E_CACHE (cal_cache), stmt, e_cal_cache_get_uint64_cb, &value, 
cancellable, error);
+
+       e_cache_sqlite_stmt_free (stmt);
+       g_free (id);
+
+       if (out_custom_flags)
+               *out_custom_flags = (guint32) value;
+
+       return success;
+}
+
 /**
  * e_cal_cache_set_component_extra:
  * @cal_cache: an #ECalCache
@@ -3007,6 +3199,7 @@ ecc_search_icalstrings_cb (ECalCache *cal_cache,
                           const gchar *revision,
                           const gchar *object,
                           const gchar *extra,
+                          guint32 custom_flags,
                           EOfflineState offline_state,
                           gpointer user_data)
 {
@@ -3094,6 +3287,7 @@ ecc_search_data_cb (ECalCache *cal_cache,
                    const gchar *revision,
                    const gchar *object,
                    const gchar *extra,
+                   guint32 custom_flags,
                    EOfflineState offline_state,
                    gpointer user_data)
 {
@@ -3115,6 +3309,7 @@ ecc_search_components_cb (ECalCache *cal_cache,
                          const gchar *revision,
                          const gchar *object,
                          const gchar *extra,
+                         guint32 custom_flags,
                          EOfflineState offline_state,
                          gpointer user_data)
 {
@@ -3136,6 +3331,7 @@ ecc_search_ids_cb (ECalCache *cal_cache,
                   const gchar *revision,
                   const gchar *object,
                   const gchar *extra,
+                  guint32 custom_flags,
                   EOfflineState offline_state,
                   gpointer user_data)
 {
@@ -3456,26 +3652,6 @@ e_cal_cache_delete_attachments (ECalCache *cal_cache,
        return TRUE;
 }
 
-static gboolean
-e_cal_cache_get_uint64_cb (ECache *cache,
-                          gint ncols,
-                          const gchar **column_names,
-                          const gchar **column_values,
-                          gpointer user_data)
-{
-       guint64 *pui64 = user_data;
-
-       g_return_val_if_fail (pui64 != NULL, FALSE);
-
-       if (ncols == 1) {
-               *pui64 = column_values[0] ? g_ascii_strtoull (column_values[0], NULL, 10) : 0;
-       } else {
-               *pui64 = 0;
-       }
-
-       return TRUE;
-}
-
 static gint
 e_cal_cache_get_current_timezone_refs (ECalCache *cal_cache,
                                       const gchar *tzid,
@@ -3945,6 +4121,7 @@ ecc_search_delete_attachment_cb (ECalCache *cal_cache,
                                 const gchar *revision,
                                 const gchar *object,
                                 const gchar *extra,
+                                guint32 custom_flags,
                                 EOfflineState offline_state,
                                 gpointer user_data)
 {
diff --git a/src/calendar/libedata-cal/e-cal-cache.h b/src/calendar/libedata-cal/e-cal-cache.h
index 995537eb5..bf15cab08 100644
--- a/src/calendar/libedata-cal/e-cal-cache.h
+++ b/src/calendar/libedata-cal/e-cal-cache.h
@@ -131,7 +131,8 @@ void                e_cal_cache_search_data_free    (/* ECalCacheSearchData * */ gpointer 
ptr);
  * @revision: the object revision
  * @object: the object itself
  * @extra: extra data stored with the object
- * @offline_state: objects offline state, one of #EOfflineState
+ * @custom_flags: object's custom flags
+ * @offline_state: object's offline state, one of #EOfflineState
  * @user_data: user data, as used in e_cal_cache_search_with_callback()
  *
  * A callback called for each object row when using
@@ -147,6 +148,7 @@ typedef gboolean (* ECalCacheSearchFunc)    (ECalCache *cal_cache,
                                                 const gchar *revision,
                                                 const gchar *object,
                                                 const gchar *extra,
+                                                guint32 custom_flags,
                                                 EOfflineState offline_state,
                                                 gpointer user_data);
 
@@ -201,23 +203,27 @@ gboolean  e_cal_cache_contains            (ECalCache *cal_cache,
 gboolean       e_cal_cache_put_component       (ECalCache *cal_cache,
                                                 ECalComponent *component,
                                                 const gchar *extra,
+                                                guint32 custom_flags,
                                                 ECacheOfflineFlag offline_flag,
                                                 GCancellable *cancellable,
                                                 GError **error);
 gboolean       e_cal_cache_put_components      (ECalCache *cal_cache,
                                                 const GSList *components, /* ECalComponent * */
                                                 const GSList *extras, /* gchar * */
+                                                const GSList *custom_flags, /* guint32, through 
GUINT_TO_POINTER() */
                                                 ECacheOfflineFlag offline_flag,
                                                 GCancellable *cancellable,
                                                 GError **error);
 gboolean       e_cal_cache_remove_component    (ECalCache *cal_cache,
                                                 const gchar *uid,
                                                 const gchar *rid,
+                                                guint32 custom_flag,
                                                 ECacheOfflineFlag offline_flag,
                                                 GCancellable *cancellable,
                                                 GError **error);
 gboolean       e_cal_cache_remove_components   (ECalCache *cal_cache,
                                                 const GSList *ids, /* ECalComponentId * */
+                                                const GSList *custom_flags, /* guint32, through 
GUINT_TO_POINTER() */
                                                 ECacheOfflineFlag offline_flag,
                                                 GCancellable *cancellable,
                                                 GError **error);
@@ -234,6 +240,20 @@ gboolean   e_cal_cache_get_component_as_string
                                                 gchar **out_icalstring,
                                                 GCancellable *cancellable,
                                                 GError **error);
+gboolean       e_cal_cache_set_component_custom_flags
+                                               (ECalCache *cal_cache,
+                                                const gchar *uid,
+                                                const gchar *rid,
+                                                guint32 custom_flags,
+                                                GCancellable *cancellable,
+                                                GError **error);
+gboolean       e_cal_cache_get_component_custom_flags
+                                               (ECalCache *cal_cache,
+                                                const gchar *uid,
+                                                const gchar *rid,
+                                                guint32 *out_custom_flags,
+                                                GCancellable *cancellable,
+                                                GError **error);
 gboolean       e_cal_cache_set_component_extra (ECalCache *cal_cache,
                                                 const gchar *uid,
                                                 const gchar *rid,
diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.c b/src/calendar/libedata-cal/e-cal-meta-backend.c
index 2846df5c8..26a83f712 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.c
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.c
@@ -132,6 +132,7 @@ static gboolean ecmb_save_component_wrapper_sync (ECalMetaBackend *meta_backend,
                                                  EConflictResolution conflict_resolution,
                                                  const GSList *in_instances,
                                                  const gchar *extra,
+                                                 guint32 opflags,
                                                  const gchar *orig_uid,
                                                  gboolean *out_requires_put,
                                                  gchar **out_new_uid,
@@ -309,6 +310,7 @@ ecmb_gather_locally_cached_objects_cb (ECalCache *cal_cache,
                                       const gchar *revision,
                                       const gchar *object,
                                       const gchar *extra,
+                                      guint32 opflags,
                                       EOfflineState offline_state,
                                       gpointer user_data)
 {
@@ -547,6 +549,7 @@ ecmb_upload_local_changes_sync (ECalMetaBackend *meta_backend,
        for (link = offline_changes; link && success; link = g_slist_next (link)) {
                ECalCacheOfflineChange *change = link->data;
                gchar *extra = NULL;
+               guint32 opflags = 0;
 
                success = !g_cancellable_set_error_if_cancelled (cancellable, error);
                if (!success)
@@ -560,6 +563,9 @@ ecmb_upload_local_changes_sync (ECalMetaBackend *meta_backend,
                if (!e_cal_cache_get_component_extra (cal_cache, change->uid, NULL, &extra, cancellable, 
NULL))
                        extra = NULL;
 
+               if (!e_cal_cache_get_component_custom_flags (cal_cache, change->uid, NULL, &opflags, 
cancellable, NULL))
+                       opflags = 0;
+
                if (change->state == E_OFFLINE_STATE_LOCALLY_CREATED ||
                    change->state == E_OFFLINE_STATE_LOCALLY_MODIFIED) {
                        GSList *instances = NULL;
@@ -568,7 +574,7 @@ ecmb_upload_local_changes_sync (ECalMetaBackend *meta_backend,
                        if (success) {
                                success = ecmb_save_component_wrapper_sync (meta_backend, cal_cache,
                                        change->state == E_OFFLINE_STATE_LOCALLY_MODIFIED,
-                                       conflict_resolution, instances, extra, change->uid, NULL, NULL, NULL, 
cancellable, error);
+                                       conflict_resolution, instances, extra, opflags, change->uid, NULL, 
NULL, NULL, cancellable, error);
                        }
 
                        g_slist_free_full (instances, g_object_unref);
@@ -576,7 +582,7 @@ ecmb_upload_local_changes_sync (ECalMetaBackend *meta_backend,
                        GError *local_error = NULL;
 
                        success = e_cal_meta_backend_remove_component_sync (meta_backend, conflict_resolution,
-                               change->uid, extra, change->object, cancellable, &local_error);
+                               change->uid, extra, change->object, opflags, cancellable, &local_error);
 
                        if (!success) {
                                if (g_error_matches (local_error, E_DATA_CAL_ERROR, ObjectNotFound)) {
@@ -607,6 +613,7 @@ ecmb_maybe_remove_from_cache (ECalMetaBackend *meta_backend,
                              ECalCache *cal_cache,
                              ECacheOfflineFlag offline_flag,
                              const gchar *uid,
+                             guint32 custom_flags,
                              GCancellable *cancellable,
                              GError **error)
 {
@@ -640,7 +647,7 @@ ecmb_maybe_remove_from_cache (ECalMetaBackend *meta_backend,
                id = e_cal_component_get_id (comp);
                if (id) {
                        if (!e_cal_cache_delete_attachments (cal_cache, e_cal_component_get_icalcomponent 
(comp), cancellable, error) ||
-                           !e_cal_cache_remove_component (cal_cache, e_cal_component_id_get_uid (id), 
e_cal_component_id_get_rid (id), offline_flag, cancellable, error)) {
+                           !e_cal_cache_remove_component (cal_cache, e_cal_component_id_get_uid (id), 
e_cal_component_id_get_rid (id), custom_flags, offline_flag, cancellable, error)) {
                                e_cal_component_id_free (id);
                                g_slist_free_full (comps, g_object_unref);
 
@@ -906,6 +913,7 @@ ecmb_put_one_component (ECalMetaBackend *meta_backend,
                        ECacheOfflineFlag offline_flag,
                        ECalComponent *comp,
                        const gchar *extra,
+                       guint32 opflags,
                        GSList **inout_cache_instances,
                        GCancellable *cancellable,
                        GError **error)
@@ -920,7 +928,7 @@ ecmb_put_one_component (ECalMetaBackend *meta_backend,
                        e_cal_component_get_icalcomponent (comp), cancellable, error);
        }
 
-       success = success && e_cal_cache_put_component (cal_cache, comp, extra, offline_flag, cancellable, 
error);
+       success = success && e_cal_cache_put_component (cal_cache, comp, extra, opflags, offline_flag, 
cancellable, error);
 
        if (success) {
                ECalComponent *existing = NULL;
@@ -953,6 +961,7 @@ ecmb_put_instances (ECalMetaBackend *meta_backend,
                    ECacheOfflineFlag offline_flag,
                    const GSList *new_instances, /* ECalComponent * */
                    const gchar *extra,
+                   guint32 opflags,
                    GCancellable *cancellable,
                    GError **error)
 {
@@ -973,7 +982,7 @@ ecmb_put_instances (ECalMetaBackend *meta_backend,
        for (link = (GSList *) new_instances; link && success; link = g_slist_next (link)) {
                ECalComponent *comp = link->data;
 
-               success = ecmb_put_one_component (meta_backend, cal_cache, offline_flag, comp, extra, 
&cache_instances, cancellable, error);
+               success = ecmb_put_one_component (meta_backend, cal_cache, offline_flag, comp, extra, 
opflags, &cache_instances, cancellable, error);
        }
 
        /* What left got removed from the remote side, notify about it */
@@ -993,7 +1002,7 @@ ecmb_put_instances (ECalMetaBackend *meta_backend,
                        if (!success)
                                break;
 
-                       success = e_cal_cache_remove_component (cal_cache, e_cal_component_id_get_uid (id), 
e_cal_component_id_get_rid (id), offline_flag, cancellable, error);
+                       success = e_cal_cache_remove_component (cal_cache, e_cal_component_id_get_uid (id), 
e_cal_component_id_get_rid (id), opflags, offline_flag, cancellable, error);
 
                        e_cal_backend_notify_component_removed (cal_backend, id, comp, NULL);
 
@@ -1109,7 +1118,7 @@ ecmb_load_component_wrapper_sync (ECalMetaBackend *meta_backend,
                new_instances = g_slist_reverse (new_instances);
 
                success = ecmb_put_instances (meta_backend, cal_cache, loaded_uid ? loaded_uid : uid, 
offline_flag,
-                       new_instances, extra ? extra : preloaded_extra, cancellable, &local_error);
+                       new_instances, extra ? extra : preloaded_extra, 0, cancellable, &local_error);
 
                if (success && out_new_uid)
                        *out_new_uid = g_strdup (loaded_uid ? loaded_uid : uid);
@@ -1140,6 +1149,7 @@ ecmb_save_component_wrapper_sync (ECalMetaBackend *meta_backend,
                                  EConflictResolution conflict_resolution,
                                  const GSList *in_instances,
                                  const gchar *extra,
+                                 guint32 opflags,
                                  const gchar *orig_uid,
                                  gboolean *out_requires_put,
                                  gchar **out_new_uid,
@@ -1181,7 +1191,7 @@ ecmb_save_component_wrapper_sync (ECalMetaBackend *meta_backend,
        }
 
        success = success && e_cal_meta_backend_save_component_sync (meta_backend, overwrite_existing, 
conflict_resolution,
-               instances ? instances : in_instances, extra, &new_uid, &new_extra, cancellable, &local_error);
+               instances ? instances : in_instances, extra, opflags, &new_uid, &new_extra, cancellable, 
&local_error);
 
        if (success && new_uid && *new_uid) {
                gchar *loaded_uid = NULL;
@@ -1190,7 +1200,7 @@ ecmb_save_component_wrapper_sync (ECalMetaBackend *meta_backend,
                        new_extra ? new_extra : extra, &loaded_uid, cancellable, error);
 
                if (success && g_strcmp0 (loaded_uid, orig_uid) != 0)
-                       success = ecmb_maybe_remove_from_cache (meta_backend, cal_cache, E_CACHE_IS_ONLINE, 
orig_uid, cancellable, error);
+                       success = ecmb_maybe_remove_from_cache (meta_backend, cal_cache, E_CACHE_IS_ONLINE, 
orig_uid, opflags, cancellable, error);
 
                if (success && out_new_uid)
                        *out_new_uid = loaded_uid;
@@ -1568,6 +1578,7 @@ ecmb_create_object_sync (ECalMetaBackend *meta_backend,
                         ECalCache *cal_cache,
                         ECacheOfflineFlag *offline_flag,
                         EConflictResolution conflict_resolution,
+                        guint32 opflags,
                         ECalComponent *comp,
                         gchar **out_new_uid,
                         ECalComponent **out_new_comp,
@@ -1637,7 +1648,7 @@ ecmb_create_object_sync (ECalMetaBackend *meta_backend,
 
                instances = g_slist_prepend (NULL, comp);
 
-               if (!ecmb_save_component_wrapper_sync (meta_backend, cal_cache, FALSE, conflict_resolution, 
instances, NULL, uid,
+               if (!ecmb_save_component_wrapper_sync (meta_backend, cal_cache, FALSE, conflict_resolution, 
instances, NULL, opflags, uid,
                        &requires_put, &new_uid, &new_extra, cancellable, error)) {
                        g_slist_free (instances);
                        return FALSE;
@@ -1647,7 +1658,7 @@ ecmb_create_object_sync (ECalMetaBackend *meta_backend,
        }
 
        if (requires_put) {
-               success = e_cal_cache_put_component (cal_cache, comp, new_extra, *offline_flag, cancellable, 
error);
+               success = e_cal_cache_put_component (cal_cache, comp, new_extra, opflags, *offline_flag, 
cancellable, error);
                if (success && !out_new_comp) {
                        e_cal_backend_notify_component_created (E_CAL_BACKEND (meta_backend), comp);
                }
@@ -1679,6 +1690,7 @@ ecmb_create_objects_sync (ECalBackendSync *sync_backend,
                          EDataCal *cal,
                          GCancellable *cancellable,
                          const GSList *calobjs,
+                         guint32 opflags,
                          GSList **out_uids,
                          GSList **out_new_components,
                          GError **error)
@@ -1686,7 +1698,7 @@ ecmb_create_objects_sync (ECalBackendSync *sync_backend,
        ECalMetaBackend *meta_backend;
        ECalCache *cal_cache;
        ECacheOfflineFlag offline_flag = E_CACHE_OFFLINE_UNKNOWN;
-       EConflictResolution conflict_resolution = E_CONFLICT_RESOLUTION_FAIL;
+       EConflictResolution conflict_resolution = e_cal_util_operation_flags_to_conflict_resolution (opflags);
        ICalComponentKind backend_kind;
        GSList *link;
        gboolean success = TRUE;
@@ -1725,7 +1737,7 @@ ecmb_create_objects_sync (ECalBackendSync *sync_backend,
                }
 
                success = ecmb_create_object_sync (meta_backend, cal_cache, &offline_flag, 
conflict_resolution,
-                       comp, &new_uid, &new_comp, cancellable, error);
+                       opflags, comp, &new_uid, &new_comp, cancellable, error);
 
                if (success) {
                        *out_uids = g_slist_prepend (*out_uids, new_uid);
@@ -1747,6 +1759,7 @@ ecmb_modify_object_sync (ECalMetaBackend *meta_backend,
                         ECacheOfflineFlag *offline_flag,
                         EConflictResolution conflict_resolution,
                         ECalObjModType mod,
+                        guint32 opflags,
                         ECalComponent *comp,
                         ECalComponent **out_old_comp,
                         ECalComponent **out_new_comp,
@@ -1915,8 +1928,8 @@ ecmb_modify_object_sync (ECalMetaBackend *meta_backend,
 
                                e_cal_recur_ensure_end_dates (comp, TRUE, e_cal_cache_resolve_timezone_cb, 
cal_cache, cancellable, NULL);
 
-                               success = ecmb_create_object_sync (meta_backend, cal_cache, offline_flag, 
E_CONFLICT_RESOLUTION_FAIL,
-                                       comp, NULL, NULL, cancellable, error);
+                               success = ecmb_create_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution,
+                                       opflags, comp, NULL, NULL, cancellable, error);
                        }
 
                        g_clear_object (&master_dtstart);
@@ -1943,11 +1956,12 @@ ecmb_modify_object_sync (ECalMetaBackend *meta_backend,
 
        if (success && *offline_flag == E_CACHE_IS_ONLINE) {
                success = ecmb_save_component_wrapper_sync (meta_backend, cal_cache, TRUE, 
conflict_resolution,
-                       instances, extra, e_cal_component_id_get_uid (id), &requires_put, &new_uid, 
&new_extra, cancellable, error);
+                       instances, extra, opflags, e_cal_component_id_get_uid (id), &requires_put, &new_uid, 
&new_extra, cancellable, error);
        }
 
        if (success && requires_put)
-               success = ecmb_put_instances (meta_backend, cal_cache, e_cal_component_id_get_uid (id), 
*offline_flag, instances, new_extra ? new_extra : extra, cancellable, error);
+               success = ecmb_put_instances (meta_backend, cal_cache, e_cal_component_id_get_uid (id), 
*offline_flag, instances,
+                       new_extra ? new_extra : extra, opflags, cancellable, error);
 
        if (!success) {
                g_clear_object (&old_comp);
@@ -1981,6 +1995,7 @@ ecmb_modify_objects_sync (ECalBackendSync *sync_backend,
                          GCancellable *cancellable,
                          const GSList *calobjs,
                          ECalObjModType mod,
+                         guint32 opflags,
                          GSList **out_old_components,
                          GSList **out_new_components,
                          GError **error)
@@ -1988,7 +2003,7 @@ ecmb_modify_objects_sync (ECalBackendSync *sync_backend,
        ECalMetaBackend *meta_backend;
        ECalCache *cal_cache;
        ECacheOfflineFlag offline_flag = E_CACHE_OFFLINE_UNKNOWN;
-       EConflictResolution conflict_resolution = E_CONFLICT_RESOLUTION_FAIL;
+       EConflictResolution conflict_resolution = e_cal_util_operation_flags_to_conflict_resolution (opflags);
        ICalComponentKind backend_kind;
        GSList *link;
        gboolean success = TRUE;
@@ -2024,7 +2039,7 @@ ecmb_modify_objects_sync (ECalBackendSync *sync_backend,
                }
 
                success = ecmb_modify_object_sync (meta_backend, cal_cache, &offline_flag, 
conflict_resolution,
-                       mod, comp, &old_comp, &new_comp, cancellable, error);
+                       mod, opflags, comp, &old_comp, &new_comp, cancellable, error);
 
                if (success) {
                        *out_old_components = g_slist_prepend (*out_old_components, old_comp);
@@ -2046,6 +2061,7 @@ ecmb_remove_object_sync (ECalMetaBackend *meta_backend,
                         ECacheOfflineFlag *offline_flag,
                         EConflictResolution conflict_resolution,
                         ECalObjModType mod,
+                        guint32 opflags,
                         const gchar *uid,
                         const gchar *rid,
                         ECalComponent **out_old_comp,
@@ -2254,7 +2270,7 @@ ecmb_remove_object_sync (ECalMetaBackend *meta_backend,
 
                                /* Use the master object, if exists */
                                if (e_cal_cache_get_component_as_string (cal_cache, uid, NULL, &ical_string, 
cancellable, NULL)) {
-                                       success = e_cal_meta_backend_remove_component_sync (meta_backend, 
conflict_resolution, uid, extra, ical_string, cancellable, &local_error);
+                                       success = e_cal_meta_backend_remove_component_sync (meta_backend, 
conflict_resolution, uid, extra, ical_string, opflags, cancellable, &local_error);
 
                                        g_free (ical_string);
                                } else {
@@ -2288,7 +2304,7 @@ ecmb_remove_object_sync (ECalMetaBackend *meta_backend,
 
                                                /* This pretends the first instance is the master object and 
the implementations should count with it */
                                                success = e_cal_meta_backend_remove_component_sync 
(meta_backend, conflict_resolution,
-                                                       e_cal_component_id_get_uid (id), comp_extra, 
ical_string, cancellable, &local_error);
+                                                       e_cal_component_id_get_uid (id), comp_extra, 
ical_string, opflags, cancellable, &local_error);
 
                                                e_cal_component_id_free (id);
                                                g_clear_pointer (&ical_string, g_free);
@@ -2308,7 +2324,7 @@ ecmb_remove_object_sync (ECalMetaBackend *meta_backend,
                                }
                        }
 
-                       success = success && ecmb_maybe_remove_from_cache (meta_backend, cal_cache, 
*offline_flag, uid, cancellable, error);
+                       success = success && ecmb_maybe_remove_from_cache (meta_backend, cal_cache, 
*offline_flag, uid, opflags, cancellable, error);
                } else {
                        gboolean requires_put = TRUE;
                        gchar *new_uid = NULL, *new_extra = NULL;
@@ -2329,11 +2345,13 @@ ecmb_remove_object_sync (ECalMetaBackend *meta_backend,
 
                        if (*offline_flag == E_CACHE_IS_ONLINE) {
                                success = ecmb_save_component_wrapper_sync (meta_backend, cal_cache, TRUE, 
conflict_resolution,
-                                       instances, extra, uid, &requires_put, &new_uid, &new_extra, 
cancellable, error);
+                                       instances, extra, opflags, uid, &requires_put, &new_uid, &new_extra, 
cancellable, error);
                        }
 
-                       if (success && requires_put)
-                               success = ecmb_put_instances (meta_backend, cal_cache, uid, *offline_flag, 
instances, new_extra ? new_extra : extra, cancellable, error);
+                       if (success && requires_put) {
+                               success = ecmb_put_instances (meta_backend, cal_cache, uid, *offline_flag, 
instances,
+                                       new_extra ? new_extra : extra, opflags, cancellable, error);
+                       }
 
                        if (success && new_uid && !requires_put) {
                                g_clear_object (&new_comp);
@@ -2370,6 +2388,7 @@ ecmb_remove_objects_sync (ECalBackendSync *sync_backend,
                          GCancellable *cancellable,
                          const GSList *ids,
                          ECalObjModType mod,
+                         guint32 opflags,
                          GSList **out_old_components,
                          GSList **out_new_components,
                          GError **error)
@@ -2377,7 +2396,7 @@ ecmb_remove_objects_sync (ECalBackendSync *sync_backend,
        ECalMetaBackend *meta_backend;
        ECalCache *cal_cache;
        ECacheOfflineFlag offline_flag = E_CACHE_OFFLINE_UNKNOWN;
-       EConflictResolution conflict_resolution = E_CONFLICT_RESOLUTION_FAIL;
+       EConflictResolution conflict_resolution = e_cal_util_operation_flags_to_conflict_resolution (opflags);
        GSList *link;
        gboolean success = TRUE;
 
@@ -2407,8 +2426,8 @@ ecmb_remove_objects_sync (ECalBackendSync *sync_backend,
                        break;
                }
 
-               success = ecmb_remove_object_sync (meta_backend, cal_cache, &offline_flag, 
conflict_resolution,
-                       mod, e_cal_component_id_get_uid (id), e_cal_component_id_get_rid (id), &old_comp, 
&new_comp, cancellable, error);
+               success = ecmb_remove_object_sync (meta_backend, cal_cache, &offline_flag, 
conflict_resolution, mod, opflags,
+                       e_cal_component_id_get_uid (id), e_cal_component_id_get_rid (id), &old_comp, 
&new_comp, cancellable, error);
 
                if (success) {
                        *out_old_components = g_slist_prepend (*out_old_components, old_comp);
@@ -2429,6 +2448,7 @@ ecmb_receive_object_sync (ECalMetaBackend *meta_backend,
                          EConflictResolution conflict_resolution,
                          ECalComponent *comp,
                          ICalPropertyMethod method,
+                         guint32 opflags,
                          GCancellable *cancellable,
                          GError **error)
 {
@@ -2485,20 +2505,20 @@ ecmb_receive_object_sync (ECalMetaBackend *meta_backend,
                if (is_in_cache) {
                        if (!is_declined) {
                                success = ecmb_modify_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution,
-                                       mod, comp, NULL, NULL, cancellable, error);
+                                       mod, opflags, comp, NULL, NULL, cancellable, error);
                        } else {
-                               success = ecmb_remove_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution,
-                                       mod, e_cal_component_id_get_uid (id), e_cal_component_id_get_rid 
(id), NULL, NULL, cancellable, error);
+                               success = ecmb_remove_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution, mod, opflags,
+                                       e_cal_component_id_get_uid (id), e_cal_component_id_get_rid (id), 
NULL, NULL, cancellable, error);
                        }
                } else if (!is_declined) {
                        success = ecmb_create_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution,
-                               comp, NULL, NULL, cancellable, error);
+                               opflags, comp, NULL, NULL, cancellable, error);
                }
                break;
        case I_CAL_METHOD_CANCEL:
                if (is_in_cache) {
-                       success = ecmb_remove_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution,
-                               E_CAL_OBJ_MOD_THIS, e_cal_component_id_get_uid (id), 
e_cal_component_id_get_rid (id), NULL, NULL, cancellable, error);
+                       success = ecmb_remove_object_sync (meta_backend, cal_cache, offline_flag, 
conflict_resolution, E_CAL_OBJ_MOD_THIS, opflags,
+                               e_cal_component_id_get_uid (id), e_cal_component_id_get_rid (id), NULL, NULL, 
cancellable, error);
                } else {
                        g_propagate_error (error, e_data_cal_create_error (ObjectNotFound, NULL));
                }
@@ -2519,11 +2539,12 @@ ecmb_receive_objects_sync (ECalBackendSync *sync_backend,
                           EDataCal *cal,
                           GCancellable *cancellable,
                           const gchar *calobj,
+                          guint32 opflags,
                           GError **error)
 {
        ECalMetaBackend *meta_backend;
        ECacheOfflineFlag offline_flag = E_CACHE_OFFLINE_UNKNOWN;
-       EConflictResolution conflict_resolution = E_CONFLICT_RESOLUTION_FAIL;
+       EConflictResolution conflict_resolution = e_cal_util_operation_flags_to_conflict_resolution (opflags);
        ECalCache *cal_cache;
        ECalComponent *comp;
        ICalComponent *icomp, *subcomp;
@@ -2599,7 +2620,7 @@ ecmb_receive_objects_sync (ECalBackendSync *sync_backend,
                }
 
                success = ecmb_receive_object_sync (meta_backend, cal_cache, &offline_flag, 
conflict_resolution,
-                       comp, method, cancellable, error);
+                       comp, method, opflags, cancellable, error);
        }
 
        g_slist_free_full (comps, g_object_unref);
@@ -2612,6 +2633,7 @@ ecmb_send_objects_sync (ECalBackendSync *sync_backend,
                        EDataCal *cal,
                        GCancellable *cancellable,
                        const gchar *calobj,
+                       guint32 opflags,
                        GSList **out_users,
                        gchar **out_modified_calobj,
                        GError **error)
@@ -2726,6 +2748,7 @@ ecmb_discard_alarm_sync (ECalBackendSync *sync_backend,
                         const gchar *uid,
                         const gchar *rid,
                         const gchar *auid,
+                        guint32 opflags,
                         GError **error)
 {
        g_return_if_fail (E_IS_CAL_META_BACKEND (sync_backend));
@@ -4643,7 +4666,7 @@ e_cal_meta_backend_process_changes_sync (ECalMetaBackend *meta_backend,
                        continue;
                }
 
-               success = ecmb_maybe_remove_from_cache (meta_backend, cal_cache, E_CACHE_IS_ONLINE, nfo->uid, 
cancellable, error);
+               success = ecmb_maybe_remove_from_cache (meta_backend, cal_cache, E_CACHE_IS_ONLINE, nfo->uid, 
0, cancellable, error);
        }
 
        /* Then modified objects */
@@ -5078,6 +5101,7 @@ e_cal_meta_backend_load_component_sync (ECalMetaBackend *meta_backend,
  * @conflict_resolution: one of #EConflictResolution, what to do on conflicts
  * @instances: (element-type ECalComponent): instances of the component to save
  * @extra: (nullable): extra data saved with the components in an #ECalCache
+ * @opflags: bit-or of #ECalOperationFlags
  * @out_new_uid: (out) (transfer full): return location for the UID of the saved component
  * @out_new_extra: (out) (transfer full): return location for the extra data to store with the component
  * @cancellable: optional #GCancellable object, or %NULL
@@ -5123,6 +5147,7 @@ e_cal_meta_backend_save_component_sync (ECalMetaBackend *meta_backend,
                                        EConflictResolution conflict_resolution,
                                        const GSList *instances,
                                        const gchar *extra,
+                                       guint32 opflags,
                                        gchar **out_new_uid,
                                        gchar **out_new_extra,
                                        GCancellable *cancellable,
@@ -5162,6 +5187,7 @@ e_cal_meta_backend_save_component_sync (ECalMetaBackend *meta_backend,
                        conflict_resolution,
                        instances,
                        extra,
+                       opflags,
                        out_new_uid,
                        out_new_extra,
                        cancellable,
@@ -5184,6 +5210,7 @@ e_cal_meta_backend_save_component_sync (ECalMetaBackend *meta_backend,
  * @uid: a component UID
  * @extra: (nullable): extra data being saved with the component in the local cache, or %NULL
  * @object: (nullable): corresponding iCalendar object, as stored in the local cache, or %NULL
+ * @opflags: bit-or of #ECalOperationFlags
  * @cancellable: optional #GCancellable object, or %NULL
  * @error: return location for a #GError, or %NULL
  *
@@ -5204,6 +5231,7 @@ e_cal_meta_backend_remove_component_sync (ECalMetaBackend *meta_backend,
                                          const gchar *uid,
                                          const gchar *extra,
                                          const gchar *object,
+                                         guint32 opflags,
                                          GCancellable *cancellable,
                                          GError **error)
 {
@@ -5233,7 +5261,7 @@ e_cal_meta_backend_remove_component_sync (ECalMetaBackend *meta_backend,
                g_clear_error (&local_error);
                repeat_count++;
 
-               success = klass->remove_component_sync (meta_backend, conflict_resolution, uid, extra, 
object, cancellable, &local_error);
+               success = klass->remove_component_sync (meta_backend, conflict_resolution, uid, extra, 
object, opflags, cancellable, &local_error);
 
                if (!success && repeat_count <= MAX_REPEAT_COUNT && !ecmb_maybe_wait_for_credentials 
(meta_backend, wait_credentials_stamp, local_error, cancellable))
                        break;
diff --git a/src/calendar/libedata-cal/e-cal-meta-backend.h b/src/calendar/libedata-cal/e-cal-meta-backend.h
index 8480a1609..3057bf27b 100644
--- a/src/calendar/libedata-cal/e-cal-meta-backend.h
+++ b/src/calendar/libedata-cal/e-cal-meta-backend.h
@@ -136,6 +136,7 @@ struct _ECalMetaBackendClass {
                                                 EConflictResolution conflict_resolution,
                                                 const GSList *instances, /* ECalComponent * */
                                                 const gchar *extra,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 gchar **out_new_uid,
                                                 gchar **out_new_extra,
                                                 GCancellable *cancellable,
@@ -146,6 +147,7 @@ struct _ECalMetaBackendClass {
                                                 const gchar *uid,
                                                 const gchar *extra,
                                                 const gchar *object,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
        gboolean        (* search_sync)         (ECalMetaBackend *meta_backend,
@@ -280,6 +282,7 @@ gboolean    e_cal_meta_backend_save_component_sync
                                                 EConflictResolution conflict_resolution,
                                                 const GSList *instances, /* ECalComponent * */
                                                 const gchar *extra,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 gchar **out_new_uid,
                                                 gchar **out_new_extra,
                                                 GCancellable *cancellable,
@@ -290,6 +293,7 @@ gboolean    e_cal_meta_backend_remove_component_sync
                                                 const gchar *uid,
                                                 const gchar *extra,
                                                 const gchar *object,
+                                                guint32 opflags, /* bit-or of ECalOperationFlags */
                                                 GCancellable *cancellable,
                                                 GError **error);
 gboolean       e_cal_meta_backend_search_sync  (ECalMetaBackend *meta_backend,
diff --git a/src/calendar/libedata-cal/e-data-cal.c b/src/calendar/libedata-cal/e-data-cal.c
index f913dd6f7..8963e02cf 100644
--- a/src/calendar/libedata-cal/e-data-cal.c
+++ b/src/calendar/libedata-cal/e-data-cal.c
@@ -951,6 +951,7 @@ static gboolean
 data_cal_handle_create_objects_cb (EDBusCalendar *dbus_interface,
                                    GDBusMethodInvocation *invocation,
                                    const gchar * const *in_calobjs,
+                                  guint32 in_opflags,
                                    EDataCal *data_cal)
 {
        ECalBackend *backend;
@@ -964,6 +965,7 @@ data_cal_handle_create_objects_cb (EDBusCalendar *dbus_interface,
        e_cal_backend_create_objects (
                backend,
                in_calobjs,
+               in_opflags,
                async_context->cancellable,
                data_cal_complete_create_objects_cb,
                async_context);
@@ -1002,6 +1004,7 @@ data_cal_handle_modify_objects_cb (EDBusCalendar *dbus_interface,
                                    GDBusMethodInvocation *invocation,
                                    const gchar * const *in_ics_objects,
                                    const gchar *in_mod_type,
+                                  guint32 in_opflags,
                                    EDataCal *data_cal)
 {
        ECalBackend *backend;
@@ -1036,7 +1039,7 @@ data_cal_handle_modify_objects_cb (EDBusCalendar *dbus_interface,
 
        e_cal_backend_modify_objects (
                backend,
-               in_ics_objects, mod,
+               in_ics_objects, mod, in_opflags,
                async_context->cancellable,
                data_cal_complete_modify_objects_cb,
                async_context);
@@ -1075,6 +1078,7 @@ data_cal_handle_remove_objects_cb (EDBusCalendar *dbus_interface,
                                    GDBusMethodInvocation *invocation,
                                    GVariant *in_uid_rid_array,
                                    const gchar *in_mod_type,
+                                  guint32 in_opflags,
                                    EDataCal *data_cal)
 {
        ECalBackend *backend;
@@ -1125,7 +1129,7 @@ data_cal_handle_remove_objects_cb (EDBusCalendar *dbus_interface,
 
        e_cal_backend_remove_objects (
                backend,
-               component_ids.head, mod,
+               component_ids.head, mod, in_opflags,
                async_context->cancellable,
                data_cal_complete_remove_objects_cb,
                async_context);
@@ -1166,6 +1170,7 @@ static gboolean
 data_cal_handle_receive_objects_cb (EDBusCalendar *dbus_interface,
                                     GDBusMethodInvocation *invocation,
                                     const gchar *in_calobj,
+                                   guint32 in_opflags,
                                     EDataCal *data_cal)
 {
        ECalBackend *backend;
@@ -1179,6 +1184,7 @@ data_cal_handle_receive_objects_cb (EDBusCalendar *dbus_interface,
        e_cal_backend_receive_objects (
                backend,
                in_calobj,
+               in_opflags,
                async_context->cancellable,
                data_cal_complete_receive_objects_cb,
                async_context);
@@ -1246,6 +1252,7 @@ static gboolean
 data_cal_handle_send_objects_cb (EDBusCalendar *dbus_interface,
                                  GDBusMethodInvocation *invocation,
                                  const gchar *in_calobj,
+                                guint32 in_opflags,
                                  EDataCal *data_cal)
 {
        ECalBackend *backend;
@@ -1259,6 +1266,7 @@ data_cal_handle_send_objects_cb (EDBusCalendar *dbus_interface,
        e_cal_backend_send_objects (
                backend,
                in_calobj,
+               in_opflags,
                async_context->cancellable,
                data_cal_complete_send_objects_cb,
                async_context);
@@ -1371,6 +1379,7 @@ data_cal_handle_discard_alarm_cb (EDBusCalendar *dbus_interface,
                                   const gchar *in_uid,
                                   const gchar *in_rid,
                                   const gchar *in_alarm_uid,
+                                 guint32 in_opflags,
                                   EDataCal *data_cal)
 {
        ECalBackend *backend;
@@ -1388,7 +1397,7 @@ data_cal_handle_discard_alarm_cb (EDBusCalendar *dbus_interface,
 
        e_cal_backend_discard_alarm (
                backend,
-               in_uid, in_rid, in_alarm_uid,
+               in_uid, in_rid, in_alarm_uid, in_opflags,
                async_context->cancellable,
                data_cal_complete_discard_alarm_cb,
                async_context);
diff --git a/src/libebackend/e-backend-enums.h b/src/libebackend/e-backend-enums.h
index 5c3656960..6fefc40a1 100644
--- a/src/libebackend/e-backend-enums.h
+++ b/src/libebackend/e-backend-enums.h
@@ -103,26 +103,4 @@ typedef enum {
        E_OFFLINE_STATE_LOCALLY_DELETED
 } EOfflineState;
 
-/**
- * EConflictResolution:
- * @E_CONFLICT_RESOLUTION_FAIL: Fail when a write-conflict occurs.
- * @E_CONFLICT_RESOLUTION_USE_NEWER: Use newer version of the object,
- *    which can be either the server version or the local version of it.
- * @E_CONFLICT_RESOLUTION_KEEP_SERVER: Keep server object on conflict.
- * @E_CONFLICT_RESOLUTION_KEEP_LOCAL: Write local version of the object on conflict.
- * @E_CONFLICT_RESOLUTION_WRITE_COPY: Create a new copy of the object on conflict.
- *
- * Defines what to do when a conflict between the locally stored and
- * remotely stored object versions happen during object modify or remove.
- *
- * Since: 3.26
- **/
-typedef enum {
-       E_CONFLICT_RESOLUTION_FAIL = 0,
-       E_CONFLICT_RESOLUTION_USE_NEWER,
-       E_CONFLICT_RESOLUTION_KEEP_SERVER,
-       E_CONFLICT_RESOLUTION_KEEP_LOCAL,
-       E_CONFLICT_RESOLUTION_WRITE_COPY
-} EConflictResolution;
-
 #endif /* E_BACKEND_ENUMS_H */
diff --git a/src/libedataserver/e-source-enums.h b/src/libedataserver/e-source-enums.h
index ec56c2b9e..19adc28b7 100644
--- a/src/libedataserver/e-source-enums.h
+++ b/src/libedataserver/e-source-enums.h
@@ -289,4 +289,26 @@ typedef enum {
        E_THREE_STATE_INCONSISTENT
 } EThreeState;
 
+/**
+ * EConflictResolution:
+ * @E_CONFLICT_RESOLUTION_FAIL: Fail when a write-conflict occurs.
+ * @E_CONFLICT_RESOLUTION_USE_NEWER: Use newer version of the object,
+ *    which can be either the server version or the local version of it.
+ * @E_CONFLICT_RESOLUTION_KEEP_SERVER: Keep server object on conflict.
+ * @E_CONFLICT_RESOLUTION_KEEP_LOCAL: Write local version of the object on conflict.
+ * @E_CONFLICT_RESOLUTION_WRITE_COPY: Create a new copy of the object on conflict.
+ *
+ * Defines what to do when a conflict between the locally stored and
+ * remotely stored object versions happen during object modify or remove.
+ *
+ * Since: 3.26
+ **/
+typedef enum {
+       E_CONFLICT_RESOLUTION_FAIL = 0,
+       E_CONFLICT_RESOLUTION_USE_NEWER,
+       E_CONFLICT_RESOLUTION_KEEP_SERVER,
+       E_CONFLICT_RESOLUTION_KEEP_LOCAL,
+       E_CONFLICT_RESOLUTION_WRITE_COPY
+} EConflictResolution;
+
 #endif /* E_SOURCE_ENUMS_H */
diff --git a/src/private/org.gnome.evolution.dataserver.Calendar.xml 
b/src/private/org.gnome.evolution.dataserver.Calendar.xml
index 2d8949e18..4caa6f9dc 100644
--- a/src/private/org.gnome.evolution.dataserver.Calendar.xml
+++ b/src/private/org.gnome.evolution.dataserver.Calendar.xml
@@ -46,25 +46,30 @@
 
   <method name="CreateObjects">
     <arg name="ics_objects" direction="in" type="as"/>
+    <arg name="opflags" direction="in" type="u"/>
     <arg name="uids" direction="out" type="as"/>
   </method>
 
   <method name="ModifyObjects">
     <arg name="ics_objects" direction="in" type="as"/>
     <arg name="mod_type" direction="in" type="s"/>
+    <arg name="opflags" direction="in" type="u"/>
   </method>
 
   <method name="RemoveObjects">
     <arg name="uid_rid_array" direction="in" type="a(ss)"/>
     <arg name="mod_type" direction="in" type="s"/>
+    <arg name="opflags" direction="in" type="u"/>
   </method>
 
   <method name="ReceiveObjects">
     <arg name="ics_object" direction="in" type="s"/>
+    <arg name="opflags" direction="in" type="u"/>
   </method>
 
   <method name="SendObjects">
     <arg name="ics_object" direction="in" type="s"/>
+    <arg name="opflags" direction="in" type="u"/>
     <arg name="users" direction="out" type="as"/>
     <arg name="out_ics_object" direction="out" type="s"/>
   </method>
@@ -97,6 +102,7 @@
     <arg name="uid" direction="in" type="s"/>
     <arg name="rid" direction="in" type="s"/>
     <arg name="alarm_uid" direction="in" type="s"/>
+    <arg name="opflags" direction="in" type="u"/>
   </method>
 
   <method name="GetTimezone">
diff --git a/tests/libecal/test-cal-client-bulk-methods.c b/tests/libecal/test-cal-client-bulk-methods.c
index e80719b08..77d9f64bb 100644
--- a/tests/libecal/test-cal-client-bulk-methods.c
+++ b/tests/libecal/test-cal-client-bulk-methods.c
@@ -148,7 +148,7 @@ test_bulk_methods_sync (ECalClient *cal_client,
        g_assert_nonnull (icomps);
 
        /* Create all the objects in bulk */
-       if (!e_cal_client_create_objects_sync (cal_client, icomps, &uids, NULL, &error))
+       if (!e_cal_client_create_objects_sync (cal_client, icomps, E_CAL_OPERATION_FLAG_NONE, &uids, NULL, 
&error))
                g_error ("create objects sync: %s", error->message);
 
        g_assert (uids != NULL);
@@ -179,7 +179,7 @@ test_bulk_methods_sync (ECalClient *cal_client,
        }
 
        /* Save the modified objects in bulk */
-       if (!e_cal_client_modify_objects_sync (cal_client, icomps, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_modify_objects_sync (cal_client, icomps, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("modify objects sync: %s", error->message);
 
        /* Retrieve all the objects and check that they have been modified */
@@ -188,7 +188,7 @@ test_bulk_methods_sync (ECalClient *cal_client,
        /* Remove all the objects in bulk */
        ids = uid_slist_to_ecalcomponentid_slist (uids);
 
-       if (!e_cal_client_remove_objects_sync (cal_client, ids, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_remove_objects_sync (cal_client, ids, E_CAL_OBJ_MOD_ALL, E_CAL_OPERATION_FLAG_NONE, 
NULL, &error))
                g_error ("remove objects sync: %s", error->message);
 
        g_slist_free_full (ids, e_cal_component_id_free);
@@ -253,8 +253,8 @@ bulk_async_modify_objects_cb (GObject *source_object,
        /* Remove all the objects in bulk */
        async_context->ids = uid_slist_to_ecalcomponentid_slist (async_context->uids);
 
-       e_cal_client_remove_objects (async_context->cal_client, async_context->ids, E_CAL_OBJ_MOD_ALL, NULL,
-               bulk_async_remove_objects_cb, async_context);
+       e_cal_client_remove_objects (async_context->cal_client, async_context->ids, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE,
+               NULL, bulk_async_remove_objects_cb, async_context);
 }
 
 static void
@@ -299,8 +299,8 @@ bulk_async_create_objects_cb (GObject *source_object,
                g_free (summary);
        }
 
-       e_cal_client_modify_objects (async_context->cal_client, async_context->icomps, E_CAL_OBJ_MOD_ALL, 
NULL,
-               bulk_async_modify_objects_cb, async_context);
+       e_cal_client_modify_objects (async_context->cal_client, async_context->icomps, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE,
+               NULL, bulk_async_modify_objects_cb, async_context);
 }
 
 static void
@@ -317,7 +317,7 @@ test_bulk_methods_async (ECalClient *cal_client,
        async_context.uids = NULL;
        async_context.main_loop = g_main_loop_new (NULL, FALSE);
 
-       e_cal_client_create_objects (async_context.cal_client, async_context.icomps, NULL,
+       e_cal_client_create_objects (async_context.cal_client, async_context.icomps, 
E_CAL_OPERATION_FLAG_NONE, NULL,
                bulk_async_create_objects_cb, &async_context);
 
        g_main_loop_run (async_context.main_loop);
diff --git a/tests/libecal/test-cal-client-create-object.c b/tests/libecal/test-cal-client-create-object.c
index 4d297fb47..b69150a14 100644
--- a/tests/libecal/test-cal-client-create-object.c
+++ b/tests/libecal/test-cal-client-create-object.c
@@ -100,7 +100,7 @@ test_create_object_sync (ETestServerFixture *fixture,
        g_clear_object (&dtstart);
        g_clear_object (&dtend);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        if (!e_cal_client_get_object_sync (cal_client, uid, NULL, &icomp2, NULL, &error))
@@ -243,7 +243,7 @@ test_create_object_async (ETestServerFixture *fixture,
 
        data.icomp = icomp;
        data.loop = fixture->loop;
-       e_cal_client_create_object (cal_client, icomp, NULL, async_write_result_ready, &data);
+       e_cal_client_create_object (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, NULL, 
async_write_result_ready, &data);
        g_main_loop_run (fixture->loop);
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-get-attachment-uris.c 
b/tests/libecal/test-cal-client-get-attachment-uris.c
index 815f2bfa7..fecba60f1 100644
--- a/tests/libecal/test-cal-client-get-attachment-uris.c
+++ b/tests/libecal/test-cal-client-get-attachment-uris.c
@@ -72,7 +72,7 @@ setup_cal (ECalClient *cal_client)
        add_attach (icomp, ATTACH2);
        add_attach (icomp, ATTACH3);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-get-free-busy.c b/tests/libecal/test-cal-client-get-free-busy.c
index 41abd46b3..0fbfce37f 100644
--- a/tests/libecal/test-cal-client-get-free-busy.c
+++ b/tests/libecal/test-cal-client-get-free-busy.c
@@ -113,7 +113,7 @@ add_component_sync (ECalClient *cal_client)
        icomp = i_cal_component_new_from_string (comp_str);
        g_assert_nonnull (icomp);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, NULL, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, NULL, NULL, 
&error))
                g_error ("Failed to add component: %s", error ? error->message : "Unknown error");
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-get-object-list.c b/tests/libecal/test-cal-client-get-object-list.c
index 0e19c7925..9bf623195 100644
--- a/tests/libecal/test-cal-client-get-object-list.c
+++ b/tests/libecal/test-cal-client-get-object-list.c
@@ -47,7 +47,7 @@ setup_cal (ECalClient *cal_client)
        g_clear_object (&dtstart);
        g_clear_object (&dtend);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-get-revision.c b/tests/libecal/test-cal-client-get-revision.c
index 5b99ccf3b..a8b7ec137 100644
--- a/tests/libecal/test-cal-client-get-revision.c
+++ b/tests/libecal/test-cal-client-get-revision.c
@@ -50,10 +50,10 @@ get_revision_compare_cycle (ECalClient *client)
                                                &revision_before, NULL, &error))
                g_error ("Error getting calendar revision: %s", error->message);
 
-       if (!e_cal_client_create_object_sync (client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, &error))
                g_error ("Error creating object: %s", error->message);
 
-       if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_remove_object_sync (client, uid, NULL, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("Error removing created object: %s", error->message);
 
        if (!e_client_get_backend_property_sync (E_CLIENT (client), CLIENT_BACKEND_PROPERTY_REVISION,
diff --git a/tests/libecal/test-cal-client-get-view.c b/tests/libecal/test-cal-client-get-view.c
index 4af213c59..99d198538 100644
--- a/tests/libecal/test-cal-client-get-view.c
+++ b/tests/libecal/test-cal-client-get-view.c
@@ -130,16 +130,16 @@ alter_cal_client (gpointer user_data)
        g_clear_object (&dtstart);
        g_clear_object (&dtend);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        i_cal_component_set_uid (icomp, uid);
        i_cal_component_set_summary (icomp, "Modified event summary");
 
-       if (!e_cal_client_modify_object_sync (cal_client, icomp, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_modify_object_sync (cal_client, icomp, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("modify object sync: %s", error->message);
 
-       if (!e_cal_client_remove_object_sync (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_remove_object_sync (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("remove object sync: %s", error->message);
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-modify-object.c b/tests/libecal/test-cal-client-modify-object.c
index 09218a248..281e12b11 100644
--- a/tests/libecal/test-cal-client-modify-object.c
+++ b/tests/libecal/test-cal-client-modify-object.c
@@ -46,7 +46,7 @@ setup_cal (ECalClient *cal_client)
        g_clear_object (&dtstart);
        g_clear_object (&dtend);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        g_object_unref (icomp);
@@ -80,7 +80,7 @@ test_modify_object_sync (ETestServerFixture *fixture,
 
        i_cal_component_set_summary (icomp, EVENT_SUMMARY);
 
-       if (!e_cal_client_modify_object_sync (cal_client, icomp, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_modify_object_sync (cal_client, icomp, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("modify object sync: %s", error->message);
 
        g_object_unref (icomp);
@@ -138,7 +138,7 @@ test_modify_object_async (ETestServerFixture *fixture,
 
        i_cal_component_set_summary (icomp, EVENT_SUMMARY);
 
-       e_cal_client_modify_object (cal_client, icomp, E_CAL_OBJ_MOD_ALL, NULL, async_modify_result_ready, 
fixture->loop);
+       e_cal_client_modify_object (cal_client, icomp, E_CAL_OBJ_MOD_ALL, E_CAL_OPERATION_FLAG_NONE, NULL, 
async_modify_result_ready, fixture->loop);
        g_object_unref (icomp);
 
        g_main_loop_run (fixture->loop);
diff --git a/tests/libecal/test-cal-client-receive-objects.c b/tests/libecal/test-cal-client-receive-objects.c
index 074e4be99..d41b74104 100644
--- a/tests/libecal/test-cal-client-receive-objects.c
+++ b/tests/libecal/test-cal-client-receive-objects.c
@@ -58,7 +58,7 @@ test_receive_objects_sync (ETestServerFixture *fixture,
        icomp = create_object ();
        g_assert_nonnull (icomp);
 
-       if (!e_cal_client_receive_objects_sync (cal_client, icomp, NULL, &error))
+       if (!e_cal_client_receive_objects_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("receive objects sync: %s", error->message);
 
        g_object_unref (icomp);
@@ -93,7 +93,7 @@ test_receive_objects_async (ETestServerFixture *fixture,
        icomp = create_object ();
        g_assert_nonnull (icomp);
 
-       e_cal_client_receive_objects (cal_client, icomp, NULL, async_receive_result_ready, fixture->loop);
+       e_cal_client_receive_objects (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, NULL, 
async_receive_result_ready, fixture->loop);
        g_object_unref (icomp);
 
        g_main_loop_run (fixture->loop);
diff --git a/tests/libecal/test-cal-client-refresh.c b/tests/libecal/test-cal-client-refresh.c
index 3da09fe7b..c506ac080 100644
--- a/tests/libecal/test-cal-client-refresh.c
+++ b/tests/libecal/test-cal-client-refresh.c
@@ -45,7 +45,7 @@ setup_cal (ECalClient *cal_client)
        g_clear_object (&dtstart);
        g_clear_object (&dtend);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-remove-object.c b/tests/libecal/test-cal-client-remove-object.c
index 9ce54e1f2..ee29eec9d 100644
--- a/tests/libecal/test-cal-client-remove-object.c
+++ b/tests/libecal/test-cal-client-remove-object.c
@@ -46,7 +46,7 @@ create_object (ECalClient *cal_client)
        g_clear_object (&dtstart);
        g_clear_object (&dtend);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        g_object_unref (icomp);
@@ -67,7 +67,7 @@ test_remove_object_sync (ETestServerFixture *fixture,
        uid = create_object (cal_client);
        g_assert (uid != NULL);
 
-       if (!e_cal_client_remove_object_sync (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_remove_object_sync (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("remove object sync: %s", error->message);
 
        g_free (uid);
@@ -102,7 +102,7 @@ test_remove_object_async (ETestServerFixture *fixture,
        uid = create_object (cal_client);
        g_assert (uid != NULL);
 
-       e_cal_client_remove_object (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, 
async_remove_result_ready, fixture->loop);
+       e_cal_client_remove_object (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, E_CAL_OPERATION_FLAG_NONE, 
NULL, async_remove_result_ready, fixture->loop);
        g_free (uid);
        g_main_loop_run (fixture->loop);
 }
@@ -119,7 +119,7 @@ test_remove_object_empty_uid (ETestServerFixture *fixture,
        cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
 
        e_cal_client_remove_object_sync (
-               cal_client, "", NULL, E_CAL_OBJ_MOD_ALL, NULL, &error);
+               cal_client, "", NULL, E_CAL_OBJ_MOD_ALL, E_CAL_OPERATION_FLAG_NONE, NULL, &error);
        g_assert_error (
                error, E_CAL_CLIENT_ERROR,
                E_CAL_CLIENT_ERROR_OBJECT_NOT_FOUND);
diff --git a/tests/libecal/test-cal-client-revision-view.c b/tests/libecal/test-cal-client-revision-view.c
index 804fe3528..d82f91cc9 100644
--- a/tests/libecal/test-cal-client-revision-view.c
+++ b/tests/libecal/test-cal-client-revision-view.c
@@ -190,16 +190,16 @@ alter_cal_client (gpointer user_data)
        i_cal_component_set_dtstart (icomp, now);
        i_cal_component_set_dtend   (icomp, itt);
 
-       if (!e_cal_client_create_object_sync (cal_client, icomp, &uid, NULL, &error))
+       if (!e_cal_client_create_object_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &uid, NULL, 
&error))
                g_error ("create object sync: %s", error->message);
 
        i_cal_component_set_uid (icomp, uid);
        i_cal_component_set_summary (icomp, "Modified event summary");
 
-       if (!e_cal_client_modify_object_sync (cal_client, icomp, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_modify_object_sync (cal_client, icomp, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("modify object sync: %s", error->message);
 
-       if (!e_cal_client_remove_object_sync (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, NULL, &error))
+       if (!e_cal_client_remove_object_sync (cal_client, uid, NULL, E_CAL_OBJ_MOD_ALL, 
E_CAL_OPERATION_FLAG_NONE, NULL, &error))
                g_error ("remove object sync: %s", error->message);
 
        g_object_unref (icomp);
diff --git a/tests/libecal/test-cal-client-send-objects.c b/tests/libecal/test-cal-client-send-objects.c
index 0ece68ad6..9f560c3ff 100644
--- a/tests/libecal/test-cal-client-send-objects.c
+++ b/tests/libecal/test-cal-client-send-objects.c
@@ -114,7 +114,7 @@ test_send_objects_sync (ETestServerFixture *fixture,
        cal_client = E_TEST_SERVER_UTILS_SERVICE (fixture, ECalClient);
 
        icomp = create_object ();
-       if (!e_cal_client_send_objects_sync (cal_client, icomp, &users, &modified_icomp, NULL, &error))
+       if (!e_cal_client_send_objects_sync (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, &users, 
&modified_icomp, NULL, &error))
                g_error ("send objects sync: %s", error->message);
 
        g_object_unref (icomp);
@@ -153,7 +153,7 @@ test_send_objects_async (ETestServerFixture *fixture,
        icomp = create_object ();
        g_assert_nonnull (icomp);
 
-       e_cal_client_send_objects (cal_client, icomp, NULL, async_send_result_ready, fixture->loop);
+       e_cal_client_send_objects (cal_client, icomp, E_CAL_OPERATION_FLAG_NONE, NULL, 
async_send_result_ready, fixture->loop);
        g_object_unref (icomp);
 
        g_main_loop_run (fixture->loop);
diff --git a/tests/libedata-cal/test-cal-cache-intervals.c b/tests/libedata-cal/test-cal-cache-intervals.c
index a72a6cf29..9e560a588 100644
--- a/tests/libedata-cal/test-cal-cache-intervals.c
+++ b/tests/libedata-cal/test-cal-cache-intervals.c
@@ -222,7 +222,7 @@ test_intervals (TCUFixture *fixture,
 
                intervals = g_slist_prepend (intervals, interval);
 
-               success = e_cal_cache_put_component (fixture->cal_cache, comp, NULL, E_CACHE_IS_ONLINE, NULL, 
&error);
+               success = e_cal_cache_put_component (fixture->cal_cache, comp, NULL, 0, E_CACHE_IS_ONLINE, 
NULL, &error);
                g_assert_no_error (error);
                g_assert (success);
        }
@@ -242,7 +242,7 @@ test_intervals (TCUFixture *fixture,
 
                intervals = g_slist_prepend (intervals, interval);
 
-               success = e_cal_cache_put_component (fixture->cal_cache, comp, NULL, E_CACHE_IS_ONLINE, NULL, 
&error);
+               success = e_cal_cache_put_component (fixture->cal_cache, comp, NULL, 0, E_CACHE_IS_ONLINE, 
NULL, &error);
                g_assert_no_error (error);
                g_assert (success);
        }
@@ -301,7 +301,7 @@ test_intervals (TCUFixture *fixture,
                        g_assert (id != NULL);
 
                        success = e_cal_cache_remove_component (fixture->cal_cache, 
e_cal_component_id_get_uid (id),
-                               e_cal_component_id_get_rid (id), E_CACHE_IS_ONLINE, NULL, &error);
+                               e_cal_component_id_get_rid (id), 0, E_CACHE_IS_ONLINE, NULL, &error);
                        g_assert_no_error (error);
                        g_assert (success);
 
diff --git a/tests/libedata-cal/test-cal-cache-offline.c b/tests/libedata-cal/test-cal-cache-offline.c
index 8e247157a..85489b916 100644
--- a/tests/libedata-cal/test-cal-cache-offline.c
+++ b/tests/libedata-cal/test-cal-cache-offline.c
@@ -340,6 +340,7 @@ test_offline_basics (TCUFixture *fixture,
        gint ii;
        const gchar *uid;
        gchar *saved_extra = NULL, *tmp;
+       guint32 custom_flags;
        GSList *ids = NULL;
        GError *error = NULL;
 
@@ -429,6 +430,14 @@ test_offline_basics (TCUFixture *fixture,
                        g_free (saved_extra);
                        saved_extra = NULL;
 
+                       g_assert (e_cal_cache_set_component_custom_flags (fixture->cal_cache, uid, NULL, 123, 
NULL, &error));
+                       g_assert_no_error (error);
+
+                       custom_flags = 0;
+                       g_assert (e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, 
&custom_flags, NULL, &error));
+                       g_assert_no_error (error);
+                       g_assert_cmpint (custom_flags, ==, 123);
+
                        /* Search when locally deleted */
                        test_basic_search (fixture, EXPECT_DEFAULT);
                } else {
@@ -452,7 +461,7 @@ test_offline_basics (TCUFixture *fixture,
        /* Edit in online */
        i_cal_component_set_summary (e_cal_component_get_icalcomponent (component), "summ-1");
 
-       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, E_CACHE_IS_ONLINE, NULL, 
&error));
+       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, 0, E_CACHE_IS_ONLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        test_verify_storage (fixture, uid, "summ-1", NULL, E_OFFLINE_STATE_SYNCED);
@@ -460,7 +469,7 @@ test_offline_basics (TCUFixture *fixture,
 
        i_cal_component_set_summary (e_cal_component_get_icalcomponent (component), "summ-2");
 
-       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, "extra-2", E_CACHE_IS_ONLINE, 
NULL, &error));
+       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, "extra-2", 0, E_CACHE_IS_ONLINE, 
NULL, &error));
        g_assert_no_error (error);
 
        test_verify_storage (fixture, uid, "summ-2", "extra-2", E_OFFLINE_STATE_SYNCED);
@@ -478,11 +487,19 @@ test_offline_basics (TCUFixture *fixture,
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 3);
        g_assert_no_error (error);
 
+       g_assert (e_cal_cache_set_component_custom_flags (fixture->cal_cache, uid, NULL, 234, NULL, &error));
+       g_assert_no_error (error);
+
+       custom_flags = 0;
+       g_assert (e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, NULL, 
&error));
+       g_assert_no_error (error);
+       g_assert_cmpint (custom_flags, ==, 234);
+
        /* Search before delete */
        test_basic_search (fixture, EXPECT_EVENT_1);
 
        /* Delete in online */
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_ONLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 0, E_CACHE_IS_ONLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        g_assert (!e_cache_set_offline_state (E_CACHE (fixture->cal_cache), uid, 
E_OFFLINE_STATE_LOCALLY_MODIFIED, NULL, &error));
@@ -510,6 +527,14 @@ test_offline_basics (TCUFixture *fixture,
        g_assert_null (ids);
        g_clear_error (&error);
 
+       g_assert (!e_cal_cache_set_component_custom_flags (fixture->cal_cache, uid, NULL, 456, NULL, &error));
+       g_assert_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND);
+       g_clear_error (&error);
+
+       g_assert (!e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, 
NULL, &error));
+       g_assert_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND);
+       g_clear_error (&error);
+
        g_clear_object (&component);
 
        /* Search after delete */
@@ -537,7 +562,7 @@ test_offline_add_one (TCUFixture *fixture,
                test_check_offline_state (fixture, uid, E_OFFLINE_STATE_UNKNOWN);
 
                /* Add a component in offline */
-               g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, E_CACHE_IS_OFFLINE, 
NULL, &error));
+               g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, 0, 
E_CACHE_IS_OFFLINE, NULL, &error));
                g_assert_no_error (error);
        } else {
                uid = case_name;
@@ -616,7 +641,7 @@ test_offline_add_edit (TCUFixture *fixture,
        /* Modify added in offline */
        i_cal_component_set_summary (e_cal_component_get_icalcomponent (component), "summ-2");
 
-       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, 0, E_CACHE_IS_OFFLINE, 
NULL, &error));
        g_assert_no_error (error);
 
        test_offline_add_one (fixture, "event-3", 4, EXPECT_EVENT_3 | EXPECT_EVENT_1 | SKIP_COMPONENT_PUT, 
NULL);
@@ -635,6 +660,7 @@ test_offline_add_delete (TCUFixture *fixture,
                         gconstpointer user_data)
 {
        ECalComponent *component = NULL;
+       guint32 custom_flags = 0;
        const gchar *uid;
        GError *error = NULL;
 
@@ -659,13 +685,37 @@ test_offline_add_delete (TCUFixture *fixture,
 
        /* Delete added in offline */
 
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 1, E_CACHE_IS_OFFLINE, NULL, 
&error));
        g_assert_no_error (error);
 
+       g_assert (!e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, 
NULL, &error));
+       g_assert_error (error, E_CACHE_ERROR, E_CACHE_ERROR_NOT_FOUND);
+       g_clear_error (&error);
+
        test_offline_add_one (fixture, "event-3", 3, EXPECT_EVENT_1 | SKIP_COMPONENT_PUT, NULL);
 
        test_check_offline_changes (fixture, NULL);
 
+       /* Add in online */
+
+       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, 333, E_CACHE_IS_ONLINE, 
NULL, &error));
+       g_assert_no_error (error);
+
+       custom_flags = 0;
+       g_assert (e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, NULL, 
&error));
+       g_assert_no_error (error);
+       g_assert_cmpint (custom_flags, ==, 333);
+
+       /* Delete in offline */
+
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 246, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert_no_error (error);
+
+       custom_flags = 0;
+       g_assert (e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, NULL, 
&error));
+       g_assert_no_error (error);
+       g_assert_cmpint (custom_flags, ==, 246);
+
        g_clear_object (&component);
 }
 
@@ -697,7 +747,7 @@ test_offline_add_delete_add (TCUFixture *fixture,
        g_assert_nonnull (uid);
 
        /* Delete added in offline */
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 0, E_CACHE_IS_OFFLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        test_offline_add_one (fixture, "event-3", 3, EXPECT_EVENT_1 | SKIP_COMPONENT_PUT, NULL);
@@ -752,6 +802,7 @@ test_offline_edit_common (TCUFixture *fixture,
                          gchar **out_uid)
 {
        ECalComponent *component = NULL;
+       guint32 custom_flags = 0;
        const gchar *uid;
        GError *error = NULL;
 
@@ -768,11 +819,21 @@ test_offline_edit_common (TCUFixture *fixture,
        test_check_offline_changes (fixture, NULL);
        test_check_offline_state (fixture, uid, E_OFFLINE_STATE_SYNCED);
 
+       custom_flags = 0;
+       g_assert (e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, NULL, 
&error));
+       g_assert_no_error (error);
+       g_assert_cmpint (custom_flags, ==, 0);
+
        /* Modify in offline */
        i_cal_component_set_summary (e_cal_component_get_icalcomponent (component), "summ-2");
 
-       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, 369, E_CACHE_IS_OFFLINE, 
NULL, &error));
+       g_assert_no_error (error);
+
+       custom_flags = 0;
+       g_assert (e_cal_cache_get_component_custom_flags (fixture->cal_cache, uid, NULL, &custom_flags, NULL, 
&error));
        g_assert_no_error (error);
+       g_assert_cmpint (custom_flags, ==, 369);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 3);
        g_assert_no_error (error);
@@ -809,7 +870,7 @@ test_offline_edit_delete (TCUFixture *fixture,
        test_offline_edit_common (fixture, &uid);
 
        /* Delete the modified component in offline */
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 0, E_CACHE_IS_OFFLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 2);
@@ -875,7 +936,7 @@ test_offline_delete (TCUFixture *fixture,
        test_check_offline_state (fixture, uid, E_OFFLINE_STATE_SYNCED);
 
        /* Delete in offline */
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 0, E_CACHE_IS_OFFLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 2);
@@ -914,7 +975,7 @@ test_offline_delete_add (TCUFixture *fixture,
 
        /* Delete locally created in offline */
        test_offline_add_one (fixture, "event-3", 4, EXPECT_EVENT_3 | EXPECT_EVENT_1, NULL);
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, "event-3", NULL, E_CACHE_IS_OFFLINE, 
NULL, &error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, "event-3", NULL, 0, E_CACHE_IS_OFFLINE, 
NULL, &error));
        g_assert_no_error (error);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 3);
@@ -927,7 +988,7 @@ test_offline_delete_add (TCUFixture *fixture,
        test_check_offline_state (fixture, "event-3", E_OFFLINE_STATE_UNKNOWN);
 
        /* Delete synced in offline */
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 0, E_CACHE_IS_OFFLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 2);
@@ -954,7 +1015,7 @@ test_offline_delete_add (TCUFixture *fixture,
        /* Modify the previous component and add it again */
        i_cal_component_set_summary (e_cal_component_get_icalcomponent (component), "summ-3");
 
-       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_put_component (fixture->cal_cache, component, NULL, 0, E_CACHE_IS_OFFLINE, 
NULL, &error));
        g_assert_no_error (error);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 4);
@@ -996,7 +1057,7 @@ test_offline_delete_resync (TCUFixture *fixture,
        test_check_offline_state (fixture, uid, E_OFFLINE_STATE_SYNCED);
 
        /* Delete in offline */
-       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, E_CACHE_IS_OFFLINE, NULL, 
&error));
+       g_assert (e_cal_cache_remove_component (fixture->cal_cache, uid, NULL, 0, E_CACHE_IS_OFFLINE, NULL, 
&error));
        g_assert_no_error (error);
 
        g_assert_cmpint (e_cache_get_count (E_CACHE (fixture->cal_cache), E_CACHE_EXCLUDE_DELETED, NULL, 
&error), ==, 2);
diff --git a/tests/libedata-cal/test-cal-cache-utils.c b/tests/libedata-cal/test-cal-cache-utils.c
index 037c1fb16..e497ee413 100644
--- a/tests/libedata-cal/test-cal-cache-utils.c
+++ b/tests/libedata-cal/test-cal-cache-utils.c
@@ -208,7 +208,7 @@ tcu_add_component_from_test_case (TCUFixture *fixture,
 
        component = tcu_new_component_from_test_case (case_name);
 
-       if (!e_cal_cache_put_component (fixture->cal_cache, component, case_name, E_CACHE_IS_ONLINE, NULL, 
&error))
+       if (!e_cal_cache_put_component (fixture->cal_cache, component, case_name, 0, E_CACHE_IS_ONLINE, NULL, 
&error))
                g_error ("Failed to add component: %s", error->message);
 
        if (out_component)
diff --git a/tests/libedata-cal/test-cal-meta-backend.c b/tests/libedata-cal/test-cal-meta-backend.c
index 6a528a45b..cdda78729 100644
--- a/tests/libedata-cal/test-cal-meta-backend.c
+++ b/tests/libedata-cal/test-cal-meta-backend.c
@@ -439,6 +439,7 @@ e_cal_meta_backend_test_save_component_sync (ECalMetaBackend *meta_backend,
                                             EConflictResolution conflict_resolution,
                                             const GSList *instances,
                                             const gchar *extra,
+                                            guint32 opflags,
                                             gchar **out_new_uid,
                                             gchar **out_new_extra,
                                             GCancellable *cancellable,
@@ -558,6 +559,7 @@ e_cal_meta_backend_test_remove_component_sync (ECalMetaBackend *meta_backend,
                                               const gchar *uid,
                                               const gchar *extra,
                                               const gchar *object,
+                                              guint32 opflags,
                                               GCancellable *cancellable,
                                               GError **error)
 {
@@ -1293,7 +1295,7 @@ test_empty_cache (TCUFixture *fixture,
        g_return_if_fail (backend_class->receive_objects_sync != NULL);
 
        /* This adds the object and the used timezone to the cache */
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, in_vcalobj, 
&error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, in_vcalobj, 0, 
&error);
        g_assert_no_error (error);
 
        zones = NULL;
@@ -1344,7 +1346,7 @@ test_send_objects (ECalMetaBackend *meta_backend)
        g_return_if_fail (backend_class->send_objects_sync != NULL);
 
        backend_class->send_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, calobj, &users, &modified_calobj, &error);
+               NULL, NULL, calobj, 0, &users, &modified_calobj, &error);
 
        g_assert_no_error (error);
        g_assert_null (users);
@@ -1415,7 +1417,7 @@ test_discard_alarm (ECalMetaBackend *meta_backend)
 
        /* Not implemented */
        backend_class->discard_alarm_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, "unknown-event", NULL, NULL, &error);
+               NULL, NULL, "unknown-event", NULL, NULL, 0, &error);
 
        g_assert_error (error, E_CLIENT_ERROR, E_CLIENT_ERROR_NOT_SUPPORTED);
 
@@ -1696,7 +1698,7 @@ test_timezones (ECalMetaBackend *meta_backend)
        g_assert_nonnull (comp);
 
        /* Add a component which uses TZID1, thus it's in the cache */
-       success = e_cal_cache_put_component (cal_cache, comp, NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       success = e_cal_cache_put_component (cal_cache, comp, NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
        g_assert (success);
 
@@ -1731,7 +1733,7 @@ test_timezones (ECalMetaBackend *meta_backend)
        g_assert_no_error (error);
 
        /* Add a component which uses TZID1 and TZID2, thus it's in the cache */
-       success = e_cal_cache_put_component (cal_cache, comp, NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       success = e_cal_cache_put_component (cal_cache, comp, NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
        g_assert (success);
 
@@ -1749,7 +1751,7 @@ test_timezones (ECalMetaBackend *meta_backend)
        g_assert_cmpint (tcmb_get_tzid_ref_count (cal_cache, TZID2), ==, 1);
 
        /* Remove in offline doesn't modify timezone cache, because the component is still there */
-       success = e_cal_cache_remove_component (cal_cache, "tz1", NULL, E_CACHE_IS_OFFLINE, NULL, &error);
+       success = e_cal_cache_remove_component (cal_cache, "tz1", NULL, 0, E_CACHE_IS_OFFLINE, NULL, &error);
        g_assert_no_error (error);
        g_assert (success);
 
@@ -1757,7 +1759,7 @@ test_timezones (ECalMetaBackend *meta_backend)
        g_assert_cmpint (tcmb_get_tzid_ref_count (cal_cache, TZID2), ==, 1);
 
        /* Remove in online modifies timezone cache */
-       success = e_cal_cache_remove_component (cal_cache, "tz1", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       success = e_cal_cache_remove_component (cal_cache, "tz1", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
        g_assert (success);
 
@@ -1787,7 +1789,7 @@ test_timezones (ECalMetaBackend *meta_backend)
                "END:VEVENT\r\n");
        g_assert_nonnull (comp);
 
-       success = e_cal_cache_put_component (cal_cache, comp, NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       success = e_cal_cache_put_component (cal_cache, comp, NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
        g_assert (success);
 
@@ -1805,7 +1807,7 @@ test_timezones (ECalMetaBackend *meta_backend)
        g_assert_cmpint (tcmb_get_tzid_ref_count (cal_cache, TZID2), ==, 1);
 
        /* Finally remove component straight in online, which removed the only one timezone too */
-       success = e_cal_cache_remove_component (cal_cache, "tz2", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       success = e_cal_cache_remove_component (cal_cache, "tz2", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
        g_assert (success);
 
@@ -1895,11 +1897,11 @@ test_create_objects (ECalMetaBackend *meta_backend)
        g_assert_nonnull (cal_cache);
 
        /* Prepare cache and server content */
-       e_cal_cache_remove_component (cal_cache, "event-7", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-7", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
-       e_cal_cache_remove_component (cal_cache, "event-8", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-8", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
-       e_cal_cache_remove_component (cal_cache, "event-9", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-9", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
 
        ecmb_test_remove_component (test_backend, "event-7", NULL);
@@ -1912,7 +1914,7 @@ test_create_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, tcu_new_icalstring_from_test_case ("event-1"));
 
        backend_class->create_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, &uids, &new_components, &error);
+               NULL, NULL, objects, 0, &uids, &new_components, &error);
        g_assert_error (error, E_DATA_CAL_ERROR, ObjectIdAlreadyExists);
        g_assert_null (uids);
        g_assert_null (new_components);
@@ -1925,7 +1927,7 @@ test_create_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, tcu_new_icalstring_from_test_case ("event-7"));
 
        backend_class->create_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, &uids, &new_components, &error);
+               NULL, NULL, objects, 0, &uids, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (uids), ==, 1);
        g_assert_cmpstr (uids->data, ==, "event-7");
@@ -1952,7 +1954,7 @@ test_create_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, tcu_new_icalstring_from_test_case ("event-7"));
 
        backend_class->create_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, &uids, &new_components, &error);
+               NULL, NULL, objects, 0, &uids, &new_components, &error);
        g_assert_error (error, E_DATA_CAL_ERROR, ObjectIdAlreadyExists);
        g_assert_null (uids);
        g_assert_null (new_components);
@@ -1965,7 +1967,7 @@ test_create_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, tcu_new_icalstring_from_test_case ("event-8"));
 
        backend_class->create_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, &uids, &new_components, &error);
+               NULL, NULL, objects, 0, &uids, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (uids), ==, 1);
        g_assert_cmpstr (uids->data, ==, "event-8");
@@ -2008,7 +2010,7 @@ test_create_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, calobj);
 
        backend_class->create_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, &uids, &new_components, &error);
+               NULL, NULL, objects, 0, &uids, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (uids), ==, 1);
        g_assert_cmpstr (uids->data, !=, "event-9");
@@ -2099,7 +2101,7 @@ test_modify_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, calobj);
 
        backend_class->modify_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, objects, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_error (error, E_DATA_CAL_ERROR, ObjectNotFound);
        g_assert_null (old_components);
        g_assert_null (new_components);
@@ -2110,7 +2112,7 @@ test_modify_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, ecmb_test_modify_case ("event-1", NULL));
 
        backend_class->modify_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, objects, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2142,7 +2144,7 @@ test_modify_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, ecmb_test_modify_case ("event-2", NULL));
 
        backend_class->modify_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, objects, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2181,7 +2183,7 @@ test_modify_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, ecmb_test_modify_case ("event-4", NULL));
 
        backend_class->modify_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, objects, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2208,7 +2210,7 @@ test_modify_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, ecmb_test_modify_case ("event-6", "20170227T134900"));
 
        backend_class->modify_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, E_CAL_OBJ_MOD_ONLY_THIS, &old_components, &new_components, &error);
+               NULL, NULL, objects, E_CAL_OBJ_MOD_ONLY_THIS, 0, &old_components, &new_components, &error);
        g_assert_error (error, E_DATA_CAL_ERROR, ObjectNotFound);
        g_assert_null (old_components);
        g_assert_null (new_components);
@@ -2221,7 +2223,7 @@ test_modify_objects (ECalMetaBackend *meta_backend)
        objects = g_slist_prepend (NULL, ecmb_test_modify_case ("event-6-a", NULL));
 
        backend_class->modify_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, objects, E_CAL_OBJ_MOD_ONLY_THIS, &old_components, &new_components, &error);
+               NULL, NULL, objects, E_CAL_OBJ_MOD_ONLY_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2272,7 +2274,7 @@ test_remove_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("unknown-event", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_error (error, E_DATA_CAL_ERROR, ObjectNotFound);
        g_assert_null (old_components);
        g_assert_null (new_components);
@@ -2283,7 +2285,7 @@ test_remove_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("event-1", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2310,7 +2312,7 @@ test_remove_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("event-6", "20170225T134900"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2341,7 +2343,7 @@ test_remove_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("event-6", "20170227T134900"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ONLY_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ONLY_THIS, 0, &old_components, &new_components, &error);
        g_assert_error (error, E_DATA_CAL_ERROR, ObjectNotFound);
        g_assert_null (old_components);
        g_assert_null (new_components);
@@ -2352,7 +2354,7 @@ test_remove_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("event-6", "20170227T134900"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2384,7 +2386,7 @@ test_remove_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("event-3", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ONLY_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ONLY_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2491,7 +2493,7 @@ test_receive_objects (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-2");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2514,7 +2516,7 @@ test_receive_objects (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2542,7 +2544,7 @@ test_receive_objects (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-1");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2572,7 +2574,7 @@ test_receive_objects (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-3");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2602,7 +2604,7 @@ test_receive_objects (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-4");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2648,7 +2650,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-5");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2678,7 +2680,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2707,7 +2709,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        g_assert_nonnull (calobj);
 
        backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, calobj, &error);
+               NULL, NULL, calobj, 0, &error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2728,7 +2730,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2760,7 +2762,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180502T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2803,7 +2805,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2833,7 +2835,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2874,7 +2876,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2893,7 +2895,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2920,7 +2922,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2928,7 +2930,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", NULL));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -2958,7 +2960,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -2977,7 +2979,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180502T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -3005,7 +3007,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -3024,7 +3026,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180502T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -3052,7 +3054,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-7");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -3073,7 +3075,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180502T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -3107,7 +3109,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-6");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -3116,7 +3118,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (ids, e_cal_component_id_new ("invite-detached", "20180509T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 2);
        g_assert_cmpint (g_slist_length (new_components), ==, 2);
@@ -3147,7 +3149,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-7");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -3168,7 +3170,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180509T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -3198,7 +3200,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-7");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -3227,7 +3229,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        calobj = tcu_new_icalstring_from_test_case ("invite-5");
        g_assert_nonnull (calobj);
 
-       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, &error);
+       backend_class->receive_objects_sync (E_CAL_BACKEND_SYNC (meta_backend), NULL, NULL, calobj, 0, 
&error);
        g_assert_no_error (error);
        g_free (calobj);
 
@@ -3252,7 +3254,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180509T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_THIS, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -3288,7 +3290,7 @@ test_receive_and_remove (ECalMetaBackend *meta_backend)
        ids = g_slist_prepend (NULL, e_cal_component_id_new ("invite-detached", "20180502T000000Z"));
 
        backend_class->remove_objects_sync (E_CAL_BACKEND_SYNC (meta_backend),
-               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, &old_components, &new_components, &error);
+               NULL, NULL, ids, E_CAL_OBJ_MOD_ALL, 0, &old_components, &new_components, &error);
        g_assert_no_error (error);
        g_assert_cmpint (g_slist_length (old_components), ==, 1);
        g_assert_cmpint (g_slist_length (new_components), ==, 1);
@@ -3339,11 +3341,11 @@ test_get_object (ECalMetaBackend *meta_backend)
        cal_cache = e_cal_meta_backend_ref_cache (meta_backend);
        g_assert_nonnull (cal_cache);
 
-       e_cal_cache_remove_component (cal_cache, "event-7", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-7", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
-       e_cal_cache_remove_component (cal_cache, "event-8", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-8", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
-       e_cal_cache_remove_component (cal_cache, "event-9", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-9", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
 
        /* Master object with its detached instances */
@@ -3403,7 +3405,7 @@ test_get_object (ECalMetaBackend *meta_backend)
        g_assert (e_cal_cache_contains (cal_cache, "event-7", NULL, E_CACHE_EXCLUDE_DELETED));
 
        /* Remove it from the cache, thus it's loaded from the "server" on demand */
-       e_cal_cache_remove_component (cal_cache, "event-7", NULL, E_CACHE_IS_ONLINE, NULL, &error);
+       e_cal_cache_remove_component (cal_cache, "event-7", NULL, 0, E_CACHE_IS_ONLINE, NULL, &error);
        g_assert_no_error (error);
 
        g_assert_cmpint (test_backend->connect_count, ==, 1);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]