try to work with libical1 and libical2
[citadel.git] / citadel / modules / calendar / serv_calendar.c
index 8fc0dbad1e351f3457a1a2a0d43942bf2dcfe4e7..4e296fd4abac24d723b737b9f1365a208f1864f3 100644 (file)
@@ -1749,7 +1749,7 @@ void ical_putics(void)
        }
 
        cprintf("%d Transmit data now\n", SEND_LISTING);
-       calstream = CtdlReadMessageBody(HKEY("000"), CtdlGetConfigLong("c_maxmsglen"), NULL, 0, 0);
+       calstream = CtdlReadMessageBody(HKEY("000"), CtdlGetConfigLong("c_maxmsglen"), NULL, 0);
        if (calstream == NULL) {
                return;
        }
@@ -2580,7 +2580,12 @@ CTDL_MODULE_INIT(calendar)
        {
 
                /* Tell libical to return errors instead of aborting if it gets bad data */
-               icalerror_errors_are_fatal = 0;
+
+#ifdef LIBICAL_ICAL_EXPORT     // cheap and sleazy way to detect libical >=2.0
+               icalerror_set_errors_are_fatal(0);
+#else
+               icalerror_errors_are_fatal = 0; (this was the old way)
+#endif
 
                /* Use our own application prefix in tzid's generated from system tzdata */
                icaltimezone_set_tzid_prefix("/citadel.org/");