From e3cb534c019c245838d85d7f9421c5dc0010c21e Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 28 Feb 2005 15:14:42 +0000 Subject: Fixes #72958 If the backend returns success, if the delay delivery is set, 2005-02-28 Chenthill Palanisamy Fixes #72958 * gui/dialogs/comp-editor.c: (save_comp): If the backend returns success, if the delay delivery is set, do not show them in the view, since it will not be created in the server. svn path=/trunk/; revision=28914 --- calendar/gui/dialogs/comp-editor.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'calendar/gui/dialogs/comp-editor.c') diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 6a933686f9..cb17c26300 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -592,6 +592,7 @@ save_comp (CompEditor *editor) GError *error = NULL; GHashTable *timezones; const char *orig_uid; + icalcomponent *icalcomp; priv = editor->priv; @@ -644,14 +645,36 @@ save_comp (CompEditor *editor) e_cal_component_set_attachment_list (priv->comp, cal_attachment_bar_get_attachment_list ((CalAttachmentBar *) priv->attachment_bar)); - + icalcomp = e_cal_component_get_icalcomponent (priv->comp); /* send the component to the server */ if (!cal_comp_is_on_server (priv->comp, priv->client)) { - result = e_cal_create_object (priv->client, e_cal_component_get_icalcomponent (priv->comp), NULL, &error); + result = e_cal_create_object (priv->client, icalcomp, NULL, &error); } else { - result = e_cal_modify_object (priv->client, e_cal_component_get_icalcomponent (priv->comp), priv->mod, &error); + result = e_cal_modify_object (priv->client, icalcomp, priv->mod, &error); } + /* If the delay delivery is set, the items will not be created in the server immediately, + so we need not show them in the view. They will appear as soon as the server creates + it after the delay period */ + if (result && e_cal_component_has_attendees (priv->comp)) { + gboolean delay_set = FALSE; + icalproperty *icalprop; + icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); + while (icalprop) { + const char *x_name; + + x_name = icalproperty_get_x_name (icalprop); + if (!strcmp (x_name, "X-EVOLUTION-OPTIONS-DELAY")) { + delay_set = TRUE; + break; + } + + icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY); + } + if (delay_set) + return TRUE; + } + if (!result) { GtkWidget *dlg; char *msg; -- cgit v1.2.3