[evolution-ews] Divide the timezone retrieval into seperate statements when creating a cancellation email



commit 2ec5ede36c2c697b78b99d940508b393d52b7038
Author: Or Goshen <orx goshen intel com>
Date:   Mon Aug 22 16:12:09 2011 +0300

    Divide the timezone retrieval into seperate statements when creating a cancellation email

 src/calendar/e-cal-backend-ews.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 15d062e..ad4ad7f 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -2427,8 +2427,10 @@ ewscal_send_cancellation_email (EEwsConnection *cnc, CamelAddress *from, CamelIn
 	CamelMultipart *multi;
 	CamelMimePart *text_part, *vcal_part;
 	char *ical_str;
-	icalcomponent *vcal, *vevent;
+	icalcomponent *vcal, *vevent, *vtz;
 	icalproperty *prop;
+	icaltimezone *icaltz;
+	struct icaltimetype dt;
 
 	vcal = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
 	icalcomponent_add_property (vcal, icalproperty_new_version("2.0"));
@@ -2440,7 +2442,10 @@ ewscal_send_cancellation_email (EEwsConnection *cnc, CamelAddress *from, CamelIn
 	icalcomponent_add_property (vevent, icalproperty_new_status(ICAL_STATUS_CANCELLED));
 	prop = icalcomponent_get_first_property (vevent, ICAL_METHOD_PROPERTY);
 	if (prop != NULL) icalcomponent_remove_property (vevent, prop);
-	icalcomponent_add_component (vcal, icalcomponent_new_clone (icaltimezone_get_component ((icaltimezone *)icalcomponent_get_dtstart (vevent).zone)));
+	dt = icalcomponent_get_dtstart (vevent);
+	icaltz = (icaltimezone *)dt.zone;
+	vtz = icaltimezone_get_component (icaltz);
+	icalcomponent_add_component (vcal, icalcomponent_new_clone (vtz));
 	icalcomponent_add_component (vcal, vevent);
 	text_part = camel_mime_part_new ();
 	camel_mime_part_set_content (text_part, body, strlen (body), "text/plain");



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