[evolution] itip-formatter - search for master object too



commit be4ca0bbea8eaad10bf9d2a3ec53056433d31c49
Author: Milan Crha <mcrha redhat com>
Date:   Mon May 25 16:54:25 2009 +0200

    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 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 04049ef..6c1775a 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 ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]