#include <libical/ical.h>
#include <string.h>
+#include <syslog.h>
// Check to see if two events overlap. Returns nonzero if they do.
int ical_ctdl_is_overlap(
}
}
+#ifdef DEBUG_ICAL_OVERLAP
+ syslog(LOG_DEBUG, "Comparing t1start=%s,t1end=%s to t2start=%s,t2end=%s",
+ icaltime_as_ical_string_r(t1start),
+ icaltime_as_ical_string_r(t1end),
+ icaltime_as_ical_string_r(t2start),
+ icaltime_as_ical_string_r(t2end)
+ );
+#endif
+
+
if (icaltime_is_null_time(t2end)) {
memcpy(&t2end, &t2start, sizeof(struct icaltimetype));
}
return(1);
}
-#ifdef DEBUG_ICAL_OVERLAP
- syslog(LOG_DEBUG, "Comparing t1start %d:%d t1end %d:%d t2start %d:%d t2end %d:%d",
- t1start.hour, t1start.minute, t1end.hour, t1end.minute,
- t2start.hour, t2start.minute, t2end.hour, t2end.minute
- );
-#endif
-
// Now check for overlaps using date *and* time.
// If event 1 ends before event 2 starts, there is no match.
# This program is open source software. Use, duplication, or
# disclosure are subject to the GNU General Public License v3.
-CFLAGS := $(CFLAGS) -ggdb -Wno-format-truncation
+CFLAGS := $(CFLAGS) -ggdb -Wno-format-truncation -DDEBUG_ICAL_OVERLAP
LDFLAGS := $(LDFLAGS)
SRC := server
// Compare function for "time-range" tests (RFC4791 section 9.9)
// Returns nonzero if the supplied icalcomponent occurs within the specified time range
-int caldav_time_range_filter_matches(icalcomponent *supplied_cal, char *start_str, char *end_str) {
+int caldav_time_range_filter_matches(icalcomponent *cal_in, char *start_str, char *end_str) {
struct icaltimetype start = (start_str ? icaltime_from_string(start_str) : icaltime_null_time());
struct icaltimetype end = (end_str ? icaltime_from_string(end_str) : icaltime_null_time());
+
+
+
+
+// NOTE TO ME: The header file says
+// "This converts both times to the UTC timezone and compares them."
+// LIBICAL_ICAL_EXPORT int icaltime_compare(const struct icaltimetype a, const struct icaltimetype b);
+// How does it do that without knowing the time zone? Does it use a private method to look up into the
+// parent component to find a VTIMEZONE component? Find out. If it can do that, we don't have to dezonify.
+
+
+
+
+
// make a local copy of the component because we are going to modify it by converting times to UTC
- icalcomponent *cal = icalcomponent_new_clone(supplied_cal);
+ icalcomponent *cal = icalcomponent_new_clone(cal_in);
ical_dezonify(cal);
syslog(LOG_DEBUG, "\033[7mcaldav_time_range_filter_matches()\033[0m : Does this %s fall between %s and %s ?",
// Output an HTML message, modifying it slightly to make sure it plays nice
// with the rest of our web framework.
//
-// Copyright (c) 2005-2022 by the citadel.org team
+// Copyright (c) 2005-2024 by the citadel.org team
//
// This program is open source software. Use, duplication, or disclosure is subject to the GNU General Public License v3.
// Sanitize and enhance an HTML message for display.
// Also convert weird character sets to UTF-8 if necessary.
// Also fixup img src="cid:..." type inline images to fetch the image
-StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source) {
+StrBuf *html2html(const char *charset_in, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source) {
char buf[SIZ];
char *msg;
char *ptr;
return (NULL);
}
- safestrncpy(charset, supplied_charset, sizeof charset);
+ safestrncpy(charset, charset_in, sizeof charset);
sprintf(new_window, "<a target=\"%s\" href=", TARGET);
content_length = StrLength(Source);
// Convert a text/plain message to text/html
-StrBuf *text2html(const char *supplied_charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source) {
+StrBuf *text2html(const char *charset, int treat_as_wiki, char *roomname, long msgnum, StrBuf *Source) {
StrBuf *sj = NULL;
sj = NewStrBuf();
void spawn_another_worker_thread(int *);
void worker_entry(int *);
int webserver(char *, int, int);
-