evolution-exchange r1888 - in trunk: . calendar



Author: mcrha
Date: Wed Mar  4 16:17:15 2009
New Revision: 1888
URL: http://svn.gnome.org/viewvc/evolution-exchange?rev=1888&view=rev

Log:
2009-03-04  Milan Crha  <mcrha redhat com>

	** Fix for bug #567852

	* calendar/e-cal-backend-exchange-tasks.c: (create_task_object):
	* calendar/e-cal-backend-exchange-calendar.c: (create_object): Don't
	add new CREATED, LAST-MODIFIED properties when event has one already.



Modified:
   trunk/ChangeLog
   trunk/calendar/e-cal-backend-exchange-calendar.c
   trunk/calendar/e-cal-backend-exchange-tasks.c

Modified: trunk/calendar/e-cal-backend-exchange-calendar.c
==============================================================================
--- trunk/calendar/e-cal-backend-exchange-calendar.c	(original)
+++ trunk/calendar/e-cal-backend-exchange-calendar.c	Wed Mar  4 16:17:15 2009
@@ -803,9 +803,18 @@
 	send_options = check_for_send_options (icalcomp, props);
 
 	/*set created and last_modified*/
-	current = icaltime_from_timet (time (NULL), 0);
-	icalcomponent_add_property (icalcomp, icalproperty_new_created (current));
-	icalcomponent_add_property (icalcomp, icalproperty_new_lastmodified (current));
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_CREATED_PROPERTY);
+	if (icalprop)
+		icalproperty_set_created (icalprop, current);
+	else
+		icalcomponent_add_property (icalcomp, icalproperty_new_created (current));
+
+	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_LASTMODIFIED_PROPERTY);
+	if (icalprop)
+		icalproperty_set_lastmodified (icalprop, current);
+	else
+		icalcomponent_add_property (icalcomp, icalproperty_new_lastmodified (current));
 
 	/* Fetch summary */
 	summary = icalcomponent_get_summary (icalcomp);

Modified: trunk/calendar/e-cal-backend-exchange-tasks.c
==============================================================================
--- trunk/calendar/e-cal-backend-exchange-tasks.c	(original)
+++ trunk/calendar/e-cal-backend-exchange-tasks.c	Wed Mar  4 16:17:15 2009
@@ -1042,6 +1042,7 @@
 	ECalComponent *comp;
 	icalcomponent *icalcomp, *real_icalcomp;
 	icalcomponent_kind kind;
+	icalproperty *icalprop;
 	struct icaltimetype current;
 	char *from_name = NULL, *from_addr = NULL;
 	char *boundary = NULL;
@@ -1075,9 +1076,18 @@
 		return GNOME_Evolution_Calendar_InvalidObject;
         }
 
-	current = icaltime_from_timet (time (NULL), 0);
-	icalcomponent_add_property (icalcomp, icalproperty_new_created (current));
-	icalcomponent_add_property (icalcomp, icalproperty_new_lastmodified (current));
+	current = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ());
+	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_CREATED_PROPERTY);
+	if (icalprop)
+		icalproperty_set_created (icalprop, current);
+	else
+		icalcomponent_add_property (icalcomp, icalproperty_new_created (current));
+
+	icalprop = icalcomponent_get_first_property (icalcomp, ICAL_LASTMODIFIED_PROPERTY);
+	if (icalprop)
+		icalproperty_set_lastmodified (icalprop, current);
+	else
+		icalcomponent_add_property (icalcomp, icalproperty_new_lastmodified (current));
 
 	modtime = e2k_timestamp_from_icaltime (current);
 



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