diff options
author | JP Rosevear <jpr@ximian.com> | 2004-08-11 22:44:15 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-08-11 22:44:15 +0800 |
commit | f07302c117bfc3c60a8576cbc5fb8849c1bab51d (patch) | |
tree | 5d6cf293d2e988e49fa4df99f5709335260c392c /calendar | |
parent | a6e7b3538706d4103101dacbd1682bf0a0bac6ff (diff) | |
download | gsoc2013-evolution-f07302c117bfc3c60a8576cbc5fb8849c1bab51d.tar.gz gsoc2013-evolution-f07302c117bfc3c60a8576cbc5fb8849c1bab51d.tar.zst gsoc2013-evolution-f07302c117bfc3c60a8576cbc5fb8849c1bab51d.zip |
Fixes #61555
2004-08-11 JP Rosevear <jpr@ximian.com>
Fixes #61555
* gui/dialogs/meeting-page.c (existing_attendee): check if an
attendee was pre-existing
(remove_attendee): only add the attendee to the cancel comp if it
was pre-existing
svn path=/trunk/; revision=26870
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/ChangeLog | 9 | ||||
-rw-r--r-- | calendar/gui/dialogs/meeting-page.c | 41 |
2 files changed, 44 insertions, 6 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 46f91dec78..0c74a4f539 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-08-11 JP Rosevear <jpr@ximian.com> + + Fixes #61555 + + * gui/dialogs/meeting-page.c (existing_attendee): check if an + attendee was pre-existing + (remove_attendee): only add the attendee to the cancel comp if it + was pre-existing + 2004-08-10 Rodrigo Moya <rodrigo@novell.com> * gui/e-cal-model.c (e_cal_model_set_search_query): guard against diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 5ac0d587d9..b72bee0f75 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -602,6 +602,32 @@ add_clicked_cb (GtkButton *btn, MeetingPage *mpage) e_meeting_list_view_edit (mpage->priv->list_view, attendee); } +static gboolean +existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +{ + GSList *attendees, *l; + const gchar *ia_address; + + ia_address = itip_strip_mailto (e_meeting_attendee_get_address (ia)); + if (!ia_address) + return FALSE; + + e_cal_component_get_attendee_list (comp, &attendees); + + for (l = attendees; l; l = l->next) { + ECalComponentAttendee *attendee = l->data; + const char *address; + + address = itip_strip_mailto (attendee->value); + if (address && !g_strcasecmp (ia_address, address)) + return TRUE; + } + + e_cal_component_free_attendee_list (attendees); + + return FALSE; +} + static void remove_attendee (MeetingPage *mpage, EMeetingAttendee *ia) { @@ -610,8 +636,8 @@ remove_attendee (MeetingPage *mpage, EMeetingAttendee *ia) priv = mpage->priv; - /* If the user deletes the attendee explicitly, assume they no - longer want the organizer showing up */ + /* If the user deletes the organizer attendee explicitly, + assume they no longer want the organizer showing up */ if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; @@ -632,12 +658,15 @@ remove_attendee (MeetingPage *mpage, EMeetingAttendee *ia) while (ia != NULL) { EMeetingAttendee *ib = NULL; - g_object_ref (ia); - g_ptr_array_add (priv->deleted_attendees, ia); - e_meeting_store_remove_attendee (priv->model, ia); - + if (existing_attendee (ia, priv->comp)) { + g_object_ref (ia); + g_ptr_array_add (priv->deleted_attendees, ia); + } + if (e_meeting_attendee_get_delto (ia) != NULL) ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delto (ia), NULL); + e_meeting_store_remove_attendee (priv->model, ia); + ia = ib; } |