From a8abd0060bdec73f774c665dd0488623dd4932ba Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 23 Jan 2009 11:41:55 +0000 Subject: ** Fix for bug #442869 2009-01-23 Milan Crha ** Fix for bug #442869 * gui/dialogs/task-page.c: (attendee_added_cb): * gui/dialogs/event-page.c: (attendee_added_cb): Do not work with NULL delegator and do not set 'delfrom' with two MAILTO. * gui/e-meeting-list-view.c: (name_selector_dialog_close_cb): Delete attendee only if we have enough rights for it. svn path=/trunk/; revision=37123 --- calendar/ChangeLog | 10 ++++++++++ calendar/gui/dialogs/event-page.c | 41 +++++++++++++++++++------------------- calendar/gui/dialogs/task-page.c | 5 ++++- calendar/gui/e-meeting-list-view.c | 8 ++++++-- 4 files changed, 41 insertions(+), 23 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 8b39b3b09a..5d411ada43 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2009-01-23 Milan Crha + + ** Fix for bug #442869 + + * gui/dialogs/task-page.c: (attendee_added_cb): + * gui/dialogs/event-page.c: (attendee_added_cb): Do not work + with NULL delegator and do not set 'delfrom' with two MAILTO. + * gui/e-meeting-list-view.c: (name_selector_dialog_close_cb): + Delete attendee only if we have enough rights for it. + 2009-01-21 Milan Crha ** Fix for bug #362754 diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index ca42dd92fb..ffbd37d850 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -1825,27 +1825,28 @@ attendee_added_cb (EMeetingListView *emlv, client = comp_editor_get_client (editor); flags = comp_editor_get_flags (editor); - if (flags & COMP_EDITOR_DELEGATE) { - if (existing_attendee (ia, priv->comp)) - e_meeting_store_remove_attendee (priv->model, ia); - else { - if (!e_cal_get_static_capability (client, - CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) { - const char *delegator_id = e_meeting_attendee_get_delfrom (ia); - EMeetingAttendee *delegator; - - delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL); - e_meeting_attendee_set_delto (delegator, - g_strdup (e_meeting_attendee_get_address (ia))); - - e_meeting_attendee_set_delfrom (ia, g_strdup_printf ("MAILTO:%s", delegator_id)); - gtk_widget_set_sensitive (priv->invite, FALSE); - gtk_widget_set_sensitive (priv->add, FALSE); - gtk_widget_set_sensitive (priv->edit, FALSE); - } - } -} + if (!(flags & COMP_EDITOR_DELEGATE)) + return; + + if (existing_attendee (ia, priv->comp)) { + e_meeting_store_remove_attendee (priv->model, ia); + } else { + if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) { + const char *delegator_id = e_meeting_attendee_get_delfrom (ia); + EMeetingAttendee *delegator; + delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL); + + g_return_if_fail (delegator != NULL); + + e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia))); + + e_meeting_attendee_set_delfrom (ia, g_strdup (delegator_id)); + gtk_widget_set_sensitive (priv->invite, FALSE); + gtk_widget_set_sensitive (priv->add, FALSE); + gtk_widget_set_sensitive (priv->edit, FALSE); + } + } } /* Callbacks for list view*/ diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 7f2969abd2..c00a42f4bc 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -1160,8 +1160,11 @@ attendee_added_cb (EMeetingListView *emlv, EMeetingAttendee *delegator; delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL); + + g_return_if_fail (delegator != NULL); + e_meeting_attendee_set_delto (delegator, - g_strdup (e_meeting_attendee_get_address (ia))); + g_strdup (e_meeting_attendee_get_address (ia))); gtk_widget_set_sensitive (priv->invite, FALSE); gtk_widget_set_sensitive (priv->add, FALSE); diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 95bdcdff19..9859c65df9 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -898,8 +898,12 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, gint response, gpoin ma = e_meeting_store_find_attendee (store, email, &i); - if (ma) - e_meeting_store_remove_attendee (store, ma); + if (ma) { + if (e_meeting_attendee_get_edit_level (ma) != E_MEETING_ATTENDEE_EDIT_FULL) + g_warning ("Not enough rights to delete attendee: %s\n", e_meeting_attendee_get_address (ma)); + else + e_meeting_store_remove_attendee (store, ma); + } } g_slist_free (la); -- cgit