From 73d12b245573eccbfbea92ae148f7e2e2eef674d Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Date: Tue, 16 Sep 2008 12:27:21 -0400 Subject: [PATCH] Informing the ID (a.k.a. edit_url) to opensync after commiting changes. --- src/gcalendar.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gcalendar.c b/src/gcalendar.c index 1e24f53..e0067a2 100644 --- a/src/gcalendar.c +++ b/src/gcalendar.c @@ -443,7 +443,6 @@ static void gc_commit_change_calendar(void *data, OSyncPluginInfo *info, msg = "Failed recovering updated fields!\n"; goto error; } - /* TODO: inform back the id/edit_url/last_updated */ break; case OSYNC_CHANGE_TYPE_MODIFIED: @@ -458,7 +457,6 @@ static void gc_commit_change_calendar(void *data, OSyncPluginInfo *info, msg = "Failed recovering updated fields!\n"; goto error; } - /* TODO: inform back the edit_url/last_updated */ break; case OSYNC_CHANGE_TYPE_DELETED: @@ -482,9 +480,13 @@ static void gc_commit_change_calendar(void *data, OSyncPluginInfo *info, if (updated_event) free(updated_event); - if (event) + if (event) { + /* Inform the new ID */ + osync_change_set_uid(change, gcal_event_get_url(event)); gcal_event_delete(event); + } + osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); @@ -539,7 +541,6 @@ static void gc_commit_change_contact(void *data, OSyncPluginInfo *info, msg = "Failed recovering updated fields!\n"; goto error; } - /* TODO: inform back the id/edit_url/last_updated */ break; case OSYNC_CHANGE_TYPE_MODIFIED: @@ -554,7 +555,6 @@ static void gc_commit_change_contact(void *data, OSyncPluginInfo *info, msg = "Failed recovering updated fields!\n"; goto error; } - /* TODO: inform back the id/edit_url/last_updated */ break; case OSYNC_CHANGE_TYPE_DELETED: @@ -578,8 +578,10 @@ static void gc_commit_change_contact(void *data, OSyncPluginInfo *info, if (updated_contact) free(updated_contact); - if (contact) - free(contact); + if (contact) { + osync_change_set_uid(change, gcal_contact_get_url(contact)); + gcal_contact_delete(contact); + } osync_context_report_success(ctx); osync_trace(TRACE_EXIT, "%s", __func__); -- 2.11.4.GIT