[evolution-activesync/for-master/allday: 2/4] _eas2ical_convert_datetime_property: add warning if all day event sanity check fails. I.e. if all da



commit 1f9f8498576fafd3385bc16a2d4332843bdb2e16
Author: Graham R. Cobb <g+syncevolution cobb uk net>
Date:   Tue Oct 28 22:51:48 2014 +0000

    _eas2ical_convert_datetime_property: add warning if all day event sanity check fails. I.e. if all day 
event start/finish is not at midnight.

 eas-daemon/libeas/eas-cal-info-translator.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/eas-daemon/libeas/eas-cal-info-translator.c b/eas-daemon/libeas/eas-cal-info-translator.c
index 85e1041..b69ca1c 100644
--- a/eas-daemon/libeas/eas-cal-info-translator.c
+++ b/eas-daemon/libeas/eas-cal-info-translator.c
@@ -470,9 +470,16 @@ static gboolean _eas2ical_convert_datetime_property(icalproperty *prop,
                        // on 123together.com, but only for events created via ActiveSync,
                        // not for events created via OWA. If the check fails, then don't
                        // do the conversion to local time.
-                       if (!isAllDayEvent ||
-                           (!localtt.hour && !localtt.minute && !localtt.second))
-                               tt = localtt;
+                       if (isAllDayEvent) {
+                               if (localtt.hour || localtt.minute || localtt.second)
+                                       g_warning("All day event does not start/finish at local midnight: %s. 
 Reverting to EAS specified time: %s",
+                                                 icaltime_as_ical_string(localtt),
+                                                 icaltime_as_ical_string(tt));
+                               else tt=localtt;
+                       } else tt=localtt;
+               } else {
+                       if (tt.hour || tt.minute || tt.second)
+                               g_warning("All day event with no timezone does not start at UTC midnight: 
%s", icaltime_as_ical_string_r(tt));
                }
                if (isAllDayEvent)
                        tt.is_date = 1;


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