/* CtdlLogPrintf(9, " * ...and we handle that internally.\n"); */
}
else {
+ /* try attached first */
t = icalcomponent_get_timezone(cal, tzid);
- /* CtdlLogPrintf(9, " * ...and I %s have tzdata for that zone.\n",
+/*
+ lprintf(9, " * ...and I %s have tzdata for that zone.\n",
(t ? "DO" : "DO NOT")
- ); */
+ );
+*/
+ /* then try built-in timezones */
+ if (!t) {
+ t = icaltimezone_get_builtin_timezone(tzid);
+/*
+ if (t) {
+ lprintf(9, " * Using system tzdata!\n");
+ }
+*/
+ }
}
}
void ical_add(icalcomponent *cal, int recursion_level) {
icalcomponent *c;
+#if 1
+ /* Write the whole thing because it may need to save timezones etc.
+ * FIXME - if this works, we can probably eliminate this entire function
+ */
+
+ ical_write_to_cal(&CC->user, cal);
+
+#else /* this was the old code to kill everything but the VEVENT component ... probably ng now */
+
/*
* The VEVENT subcomponent is the one we're interested in saving.
*/
/* Recursively process subcomponent */
ical_add(c, recursion_level+1);
}
+#endif
}
icalcomponent_remove_property(Cal->cal, ps);
ps = icalproperty_new_dtstart(next);
icalcomponent_add_property(Cal->cal, ps);
- ical_dezonify(Cal->cal); /* dezonify every recurrence - we may
+ /*ical_dezonify(Cal->cal);*/ /* dezonify every recurrence - we may
* have hit the start/end of DST */
Cal->event_start = icaltime_as_timet(next);
lprintf(9, "\e[32mREPEATS: %s, is_utc=%d, tzid=%s\e[0m\n",
cal = icalcomponent_new_from_string(relevant_source);
if (cal != NULL) {
+ /* FIXME temp */
+ lprintf(9, "HERE WE GO:\n%s\n", icalcomponent_as_ical_string(cal));
+ icalproperty *p;
+ p = icalcomponent_get_first_property(cal, ICAL_DTSTART_PROPERTY);
+ if (p) {
+ lprintf(9, "DTSTART IS %s\n",
+ icaltime_as_ical_string(
+ icalproperty_get_dtstart(p)
+ )
+ );
+ }
+ /* */
+
/* A which_kind of (-1) means just load the whole thing */
if (which_kind == (-1)) {
#include "webcit.h"
#include "webserver.h"
+#define DBG_ICAL 1
+
/*
* Figure out which time zone needs to be used for timestamps that are
#endif
}
else {
+ /* try attached first */
t = icalcomponent_get_timezone(cal, tzid);
#ifdef DBG_ICAL
lprintf(9, " * ...and I %s have tzdata for that zone.\n",
(t ? "DO" : "DO NOT")
);
#endif
+ /* then try built-in timezones */
+ if (!t) {
+ t = icaltimezone_get_builtin_timezone(tzid);
+#ifdef DBG_ICAL
+ if (t) {
+ lprintf(9, " * Using system tzdata!\n");
+ }
+#endif
+ }
}
}
Put(ZoneHash, HKEY("UTC"), ZName, HFreeStrBuf);
zones = icaltimezone_get_builtin_timezones();
for (z = 0; z < zones->num_elements; ++z) {
+ /* lprintf(9, "Location: %-40s tzid: %s\n",
+ icaltimezone_get_location(icalarray_element_at(zones, z)),
+ icaltimezone_get_tzid(icalarray_element_at(zones, z))
+ ); */
this_zone = icaltimezone_get_location(icalarray_element_at(zones, z));
len = strlen(this_zone);
ZName = NewStrBufPlain(this_zone, len);