From 1bb481409ffa20416c7531ebe4327d77db1796e2 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Thu, 24 Oct 2002 14:25:53 +0000 Subject: initialize new values (clean_up): free new values (find_my_address): if we 2002-10-24 JP Rosevear * gui/e-itip-control.c (init): initialize new values (clean_up): free new values (find_my_address): if we have a delegator address, use it instead (write_html): display delegator info to user (show_current_event): if we have a calendar uri, use that and describe the event differently (show_current_todo): ditto (show_current): search for delegator X properties (e_itip_control_set_delegator_address): accessor (e_itip_control_get_delegator_address): ditto (e_itip_control_set_delegator_name): ditto (e_itip_control_get_delegator_name): ditto (e_itip_control_set_calendar_uri): ditto (e_itip_control_get_calendar_uri): ditto * gui/e-itip-control.h: add protos * gui/itip-utils.c (comp_from): use the first attendee as the from address for things other than request, cancel and add (use organizer) and publish (use default address) svn path=/trunk/; revision=18425 --- calendar/gui/itip-utils.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'calendar/gui/itip-utils.c') diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 76e23e47f1..f5c70086c0 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -331,10 +331,17 @@ static CORBA_char * comp_from (CalComponentItipMethod method, CalComponent *comp) { CalComponentOrganizer organizer; - + CalComponentAttendee *attendee; + GSList *attendees; + CORBA_char *str; + switch (method) { + case CAL_COMPONENT_METHOD_PUBLISH: + return CORBA_string_dup (""); + case CAL_COMPONENT_METHOD_REQUEST: case CAL_COMPONENT_METHOD_CANCEL: + case CAL_COMPONENT_METHOD_ADD: cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, @@ -345,7 +352,15 @@ comp_from (CalComponentItipMethod method, CalComponent *comp) return CORBA_string_dup (itip_strip_mailto (organizer.value)); default: - return CORBA_string_dup (""); + if (!cal_component_has_attendees (comp)) + return CORBA_string_dup (""); + + cal_component_get_attendee_list (comp, &attendees); + attendee = attendees->data; + str = CORBA_string_dup (attendee->value ? itip_strip_mailto (attendee->value) : ""); + cal_component_free_attendee_list (attendees); + + return str; } } -- cgit