|
|
329b04 |
diff -up evolution-mapi-3.12.10/src/libexchangemapi/e-mapi-cal-utils.c.freebusy-time-calc evolution-mapi-3.12.10/src/libexchangemapi/e-mapi-cal-utils.c
|
|
|
329b04 |
--- evolution-mapi-3.12.10/src/libexchangemapi/e-mapi-cal-utils.c.freebusy-time-calc 2014-04-28 11:05:45.000000000 +0200
|
|
|
329b04 |
+++ evolution-mapi-3.12.10/src/libexchangemapi/e-mapi-cal-utils.c 2016-08-16 16:15:04.577028840 +0200
|
|
|
329b04 |
@@ -453,7 +453,6 @@ populate_freebusy_data (struct Binary_r
|
|
|
329b04 |
uint16_t event_start;
|
|
|
329b04 |
uint16_t event_end;
|
|
|
329b04 |
uint32_t i;
|
|
|
329b04 |
- uint32_t hour;
|
|
|
329b04 |
uint32_t day;
|
|
|
329b04 |
const gchar *month_name;
|
|
|
329b04 |
uint32_t minutes;
|
|
|
329b04 |
@@ -478,57 +477,47 @@ populate_freebusy_data (struct Binary_r
|
|
|
329b04 |
event_start = (bin->lpb[i + 1] << 8) | bin->lpb[i];
|
|
|
329b04 |
event_end = (bin->lpb[i + 3] << 8) | bin->lpb[i + 2];
|
|
|
329b04 |
|
|
|
329b04 |
- for (hour = 0; hour < 24; hour++) {
|
|
|
329b04 |
- if (!(((event_start - (60 * hour)) % 1440) && (((event_start - (60 * hour)) % 1440) - 30))) {
|
|
|
329b04 |
- struct icalperiodtype ipt;
|
|
|
329b04 |
- icalproperty *icalprop;
|
|
|
329b04 |
- icaltimetype itt;
|
|
|
329b04 |
-
|
|
|
329b04 |
- day = ((event_start - (60 * hour)) / 1440) + 1;
|
|
|
329b04 |
- minutes = (event_start - (60 * hour)) % 1440;
|
|
|
329b04 |
- real_month = month - (year * 16);
|
|
|
329b04 |
-
|
|
|
329b04 |
- date_string = g_strdup_printf ("%.2u-%.2u-%.2u", year, real_month, day);
|
|
|
329b04 |
- start = g_strdup_printf ("%sT%.2u:%.2u:00Z", date_string, hour + daylight, minutes);
|
|
|
329b04 |
- g_free (date_string);
|
|
|
329b04 |
-
|
|
|
329b04 |
- day = ((event_end - (60 * hour)) / 1440) + 1;
|
|
|
329b04 |
- minutes = (event_end - (60 * hour)) % 1440;
|
|
|
329b04 |
-
|
|
|
329b04 |
- if (minutes >= 60) {
|
|
|
329b04 |
- hour += minutes / 60;
|
|
|
329b04 |
- minutes %= 60;
|
|
|
329b04 |
- }
|
|
|
329b04 |
-
|
|
|
329b04 |
- date_string = g_strdup_printf ("%.2u-%.2u-%.2u", year, real_month, day);
|
|
|
329b04 |
- end = g_strdup_printf ("%sT%.2u:%.2u:00Z", date_string, hour + daylight, minutes);
|
|
|
329b04 |
- g_free (date_string);
|
|
|
329b04 |
-
|
|
|
329b04 |
- start_date = mapi_get_date_from_string (start);
|
|
|
329b04 |
- end_date = mapi_get_date_from_string (end);
|
|
|
329b04 |
-
|
|
|
329b04 |
- memset (&ipt, 0, sizeof (struct icalperiodtype));
|
|
|
329b04 |
-
|
|
|
329b04 |
- itt = icaltime_from_timet_with_zone (start_date, 0, icaltimezone_get_utc_timezone ());
|
|
|
329b04 |
- ipt.start = itt;
|
|
|
329b04 |
-
|
|
|
329b04 |
- itt = icaltime_from_timet_with_zone (end_date, 0, icaltimezone_get_utc_timezone ());
|
|
|
329b04 |
- ipt.end = itt;
|
|
|
329b04 |
-
|
|
|
329b04 |
- icalcomp = e_cal_component_get_icalcomponent (comp);
|
|
|
329b04 |
- icalprop = icalproperty_new_freebusy (ipt);
|
|
|
329b04 |
-
|
|
|
329b04 |
- if (!strcmp (accept_type, "Busy"))
|
|
|
329b04 |
- icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "BUSY");
|
|
|
329b04 |
- else if (!strcmp (accept_type, "Tentative"))
|
|
|
329b04 |
- icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "BUSY-TENTATIVE");
|
|
|
329b04 |
- else if (!strcmp (accept_type, "OutOfOffice"))
|
|
|
329b04 |
- icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "BUSY-UNAVAILABLE");
|
|
|
329b04 |
-
|
|
|
329b04 |
- icalcomponent_add_property(icalcomp, icalprop);
|
|
|
329b04 |
- g_free (start);
|
|
|
329b04 |
- g_free (end);
|
|
|
329b04 |
- }
|
|
|
329b04 |
+ if (event_start <= event_end) {
|
|
|
329b04 |
+ struct icalperiodtype ipt;
|
|
|
329b04 |
+ icalproperty *icalprop;
|
|
|
329b04 |
+ icaltimetype itt;
|
|
|
329b04 |
+
|
|
|
329b04 |
+ day = 1;
|
|
|
329b04 |
+ minutes = 0;
|
|
|
329b04 |
+ real_month = month - (year * 16);
|
|
|
329b04 |
+
|
|
|
329b04 |
+ date_string = g_strdup_printf ("%.2u-%.2u-%.2u", year, real_month, day);
|
|
|
329b04 |
+ start = g_strdup_printf ("%sT%.2u:%.2u:00Z", date_string, 0, minutes);
|
|
|
329b04 |
+ g_free (date_string);
|
|
|
329b04 |
+
|
|
|
329b04 |
+ date_string = g_strdup_printf ("%.2u-%.2u-%.2u", year, real_month, day);
|
|
|
329b04 |
+ end = g_strdup_printf ("%sT%.2u:%.2u:00Z", date_string, 0, minutes);
|
|
|
329b04 |
+ g_free (date_string);
|
|
|
329b04 |
+
|
|
|
329b04 |
+ start_date = mapi_get_date_from_string (start) + (60 * event_start);
|
|
|
329b04 |
+ end_date = mapi_get_date_from_string (end) + (60 * event_end);
|
|
|
329b04 |
+
|
|
|
329b04 |
+ memset (&ipt, 0, sizeof (struct icalperiodtype));
|
|
|
329b04 |
+
|
|
|
329b04 |
+ itt = icaltime_from_timet_with_zone (start_date, 0, icaltimezone_get_utc_timezone ());
|
|
|
329b04 |
+ ipt.start = itt;
|
|
|
329b04 |
+
|
|
|
329b04 |
+ itt = icaltime_from_timet_with_zone (end_date, 0, icaltimezone_get_utc_timezone ());
|
|
|
329b04 |
+ ipt.end = itt;
|
|
|
329b04 |
+
|
|
|
329b04 |
+ icalcomp = e_cal_component_get_icalcomponent (comp);
|
|
|
329b04 |
+ icalprop = icalproperty_new_freebusy (ipt);
|
|
|
329b04 |
+
|
|
|
329b04 |
+ if (!strcmp (accept_type, "Busy"))
|
|
|
329b04 |
+ icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "BUSY");
|
|
|
329b04 |
+ else if (!strcmp (accept_type, "Tentative"))
|
|
|
329b04 |
+ icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "BUSY-TENTATIVE");
|
|
|
329b04 |
+ else if (!strcmp (accept_type, "OutOfOffice"))
|
|
|
329b04 |
+ icalproperty_set_parameter_from_string (icalprop, "FBTYPE", "BUSY-UNAVAILABLE");
|
|
|
329b04 |
+
|
|
|
329b04 |
+ icalcomponent_add_property(icalcomp, icalprop);
|
|
|
329b04 |
+ g_free (start);
|
|
|
329b04 |
+ g_free (end);
|
|
|
329b04 |
}
|
|
|
329b04 |
}
|
|
|
329b04 |
}
|