diff options
Diffstat (limited to 'calendar/gui/e-meeting-store.c')
-rw-r--r-- | calendar/gui/e-meeting-store.c | 67 |
1 files changed, 54 insertions, 13 deletions
diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index d215b2decc..b8e065e2dd 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1340,6 +1340,31 @@ process_callbacks (EMeetingStoreQueueData *qdata) } static void +process_free_busy_comp_get_xfb (icalproperty *ip, + gchar **summary, + gchar **location) +{ + const gchar *tmp = NULL; + + g_return_if_fail (ip != NULL); + g_return_if_fail (summary != NULL && *summary == NULL); + g_return_if_fail (location != NULL && *location == NULL); + + /* We extract extended free/busy information from the icalproperty + * here (X-SUMMARY and X-LOCATION). If the property carries such, + * it will be displayed as a tooltip for the busy period. Otherwise, + * nothing will happen (*summary and/or *location will be NULL) + */ + + tmp = icalproperty_get_parameter_as_string (ip, E_MEETING_FREE_BUSY_XPROP_SUMMARY); + *summary = e_meeting_xfb_utf8_string_new_from_ical (tmp, + E_MEETING_FREE_BUSY_XPROP_MAXLEN); + tmp = icalproperty_get_parameter_as_string (ip, E_MEETING_FREE_BUSY_XPROP_LOCATION); + *location = e_meeting_xfb_utf8_string_new_from_ical (tmp, + E_MEETING_FREE_BUSY_XPROP_MAXLEN); +} + +static void process_free_busy_comp (EMeetingAttendee *attendee, icalcomponent *fb_comp, icaltimezone *zone, @@ -1422,22 +1447,38 @@ process_free_busy_comp (EMeetingAttendee *attendee, if (busy_type != E_MEETING_FREE_BUSY_LAST) { icaltimezone *utc_zone = icaltimezone_get_utc_timezone (); + gchar *summary = NULL; + gchar *location = NULL; icaltimezone_convert_time (&fb.start, utc_zone, zone); icaltimezone_convert_time (&fb.end, utc_zone, zone); - e_meeting_attendee_add_busy_period ( - attendee, - fb.start.year, - fb.start.month, - fb.start.day, - fb.start.hour, - fb.start.minute, - fb.end.year, - fb.end.month, - fb.end.day, - fb.end.hour, - fb.end.minute, - busy_type); + + /* Extract extended free/busy (XFB) information from + * the icalproperty, if it carries such. + * See the comment for the EMeetingXfbData structure + * for a reference. + */ + process_free_busy_comp_get_xfb (ip, &summary, &location); + + e_meeting_attendee_add_busy_period (attendee, + fb.start.year, + fb.start.month, + fb.start.day, + fb.start.hour, + fb.start.minute, + fb.end.year, + fb.end.month, + fb.end.day, + fb.end.hour, + fb.end.minute, + busy_type, + summary, + location); + + if (summary != NULL) + g_free (summary); + if (location != NULL) + g_free (location); } ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY); |