[evolution-mapi/gnome-3-0] Bug #649898 - Modified recurrences have incorrect time
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi/gnome-3-0] Bug #649898 - Modified recurrences have incorrect time
- Date: Mon, 16 May 2011 13:07:16 +0000 (UTC)
commit 82c21ce79aa117604ce987f045565a6f24360c48
Author: Milan Crha <mcrha redhat com>
Date: Mon May 16 15:06:50 2011 +0200
Bug #649898 - Modified recurrences have incorrect time
.../exchange-mapi-cal-recur-utils.c | 8 ++++----
.../exchange-mapi-cal-recur-utils.h | 6 ++----
src/libexchangemapi/exchange-mapi-cal-utils.c | 10 +++++++++-
3 files changed, 15 insertions(+), 9 deletions(-)
---
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.c b/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
index 6f791d5..511f2a8 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
+++ b/src/libexchangemapi/exchange-mapi-cal-recur-utils.c
@@ -247,7 +247,7 @@ check_calendar_type (guint16 type)
}
gboolean
-exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached)
+exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone)
{
struct icalrecurrencetype rt;
guint16 flag16;
@@ -731,17 +731,17 @@ exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList
tt = icaltime_from_timet_with_zone (convert_recurrence_minutes_to_timet (origtime), 0, 0);
rid.type = E_CAL_COMPONENT_RANGE_SINGLE;
rid.datetime.value = &tt;
- rid.datetime.tzid = "UTC";
+ rid.datetime.tzid = recur_zone ? icaltimezone_get_tzid (recur_zone) : "UTC";
e_cal_component_set_recurid (detached[i], &rid);
tt = icaltime_from_timet_with_zone (convert_recurrence_minutes_to_timet (starttime), 0, 0);
edt.value = &tt;
- edt.tzid = "UTC";
+ edt.tzid = recur_zone ? icaltimezone_get_tzid (recur_zone) : "UTC";
e_cal_component_set_dtstart (detached[i], &edt);
tt = icaltime_from_timet_with_zone (convert_recurrence_minutes_to_timet (endtime), 0, 0);
edt.value = &tt;
- edt.tzid = "UTC";
+ edt.tzid = recur_zone ? icaltimezone_get_tzid (recur_zone) : "UTC";
e_cal_component_set_dtend (detached[i], &edt);
e_cal_component_set_rdate_list (detached[i], NULL);
diff --git a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h b/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
index faa26b4..6b95082 100644
--- a/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
+++ b/src/libexchangemapi/exchange-mapi-cal-recur-utils.h
@@ -30,11 +30,9 @@
G_BEGIN_DECLS
-gboolean
-exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached);
+gboolean exchange_mapi_cal_util_bin_to_rrule (GByteArray *ba, ECalComponent *comp, GSList **extra_detached, icaltimezone *recur_zone);
-GByteArray *
-exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps);
+GByteArray * exchange_mapi_cal_util_rrule_to_bin (ECalComponent *comp, GSList *modified_comps);
G_END_DECLS
diff --git a/src/libexchangemapi/exchange-mapi-cal-utils.c b/src/libexchangemapi/exchange-mapi-cal-utils.c
index 40fdd5d..6a62c6a 100644
--- a/src/libexchangemapi/exchange-mapi-cal-utils.c
+++ b/src/libexchangemapi/exchange-mapi-cal-utils.c
@@ -948,7 +948,15 @@ exchange_mapi_cal_util_mapi_props_to_comp (ExchangeMapiConnection *conn, mapi_id
if (b && *b) {
stream = exchange_mapi_util_find_stream (streams, PidLidAppointmentRecur);
if (stream) {
- exchange_mapi_cal_util_bin_to_rrule (stream->value, comp, detached_components);
+ icaltimezone *recur_zone;
+ const gchar *recur_tz_location;
+
+ recur_tz_location = exchange_mapi_util_find_array_namedid (properties, conn, fid, PidLidTimeZoneDescription);
+ if (recur_tz_location)
+ recur_tz_location = exchange_mapi_cal_tz_util_get_ical_equivalent (recur_tz_location);
+ recur_zone = recur_tz_location ? icaltimezone_get_builtin_timezone (recur_tz_location) : (icaltimezone *) default_zone;
+
+ exchange_mapi_cal_util_bin_to_rrule (stream->value, comp, detached_components, recur_zone);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]