manager: pass correct rid & uid to remove-event

Passing the correct rid & uid to
e_cal_client_remove_object() ensures that
the deletion of recurrent events is
handled correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=782755
This commit is contained in:
Yash Singh
2017-06-09 22:33:46 -03:00
committed by Georges Basile Stavracas Neto
parent 7fd3e48427
commit 6b31ac88c2
+11 -5
View File
@@ -1801,8 +1801,9 @@ gcal_manager_remove_event (GcalManager *manager,
ECalObjModType mod)
{
GcalManagerUnit *unit;
ECalComponentId *id;
ECalComponent *component;
gchar* rid;
gchar* uid;
GCAL_ENTRY;
@@ -1811,7 +1812,12 @@ gcal_manager_remove_event (GcalManager *manager,
component = gcal_event_get_component (event);
unit = g_hash_table_lookup (manager->clients, gcal_event_get_source (event));
id = e_cal_component_get_id (component);
rid = NULL;
e_cal_component_get_uid (component, &uid);
if (gcal_event_has_recurrence (event))
rid = e_cal_component_get_recurid_as_string (component);
/*
* While we're removing the event, we don't want the component
@@ -1821,14 +1827,14 @@ gcal_manager_remove_event (GcalManager *manager,
g_object_ref (component);
e_cal_client_remove_object (unit->client,
id->uid,
id->rid,
uid,
rid,
mod,
manager->async_ops,
on_event_removed,
component);
e_cal_component_free_id (id);
g_free (rid);
GCAL_EXIT;
}