From be4ca0bbea8eaad10bf9d2a3ec53056433d31c49 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 25 May 2009 16:54:25 +0200 Subject: itip-formatter - search for master object too When received a detached instance, and the calendar doesn't contain that exact instance, then try to search for the master object and use it, if found. --- plugins/itip-formatter/itip-formatter.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c index 04049ef6d5..6c1775a8b5 100644 --- a/plugins/itip-formatter/itip-formatter.c +++ b/plugins/itip-formatter/itip-formatter.c @@ -629,8 +629,8 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) e_cal_free_object_list (objects); } - - if (!pitip->current_ecal && e_cal_get_object (ecal, fd->uid, fd->rid, &icalcomp, NULL)) { + /* search for a master object if the detached object doesn't exist in the calendar */ + if (!pitip->current_ecal && (e_cal_get_object (ecal, fd->uid, fd->rid, &icalcomp, NULL) || (fd->rid && e_cal_get_object (ecal, fd->uid, NULL, &icalcomp, NULL)))) { if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) && (icalcomponent_get_first_component (icalcomp, ICAL_VALARM_COMPONENT) || icalcomponent_get_first_component (icalcomp, ICAL_XAUDIOALARM_COMPONENT) || @@ -1278,7 +1278,9 @@ update_attendee_status (struct _itip_puri *pitip) org_icalcomp = e_cal_component_get_icalcomponent (pitip->comp); rid = e_cal_component_get_recurid_as_string (pitip->comp); - if (e_cal_get_object (pitip->current_ecal, uid, rid, &icalcomp, NULL)) { + + /* search for a master object if the detached object doesn't exist in the calendar */ + if (e_cal_get_object (pitip->current_ecal, uid, rid, &icalcomp, NULL) || (rid && e_cal_get_object (pitip->current_ecal, uid, NULL, &icalcomp, NULL))) { GSList *attendees; comp = e_cal_component_new (); -- cgit v1.2.3