Changed "supplied_xxx" to "xxx_in" when we modify.
authorArt Cancro <ajc@citadel.org>
Thu, 21 Mar 2024 15:54:37 +0000 (11:54 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 21 Mar 2024 15:54:37 +0000 (11:54 -0400)
citadel/server/modules/calendar/ical_ctdl_is_overlap.c
webcit-ng/Makefile
webcit-ng/server/caldav_reports.c
webcit-ng/server/html2html.c
webcit-ng/server/text2html.c
webcit-ng/server/webcit.h

index 6902fd04d1b9edca1f8b2b16258dc1c551c9410f..d980c554b53645faf385fa786a3908f0eb50dbe0 100644 (file)
@@ -8,6 +8,7 @@
 
 #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(
@@ -36,6 +37,16 @@ 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));
        }
@@ -57,13 +68,6 @@ int ical_ctdl_is_overlap(
                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.
index 291a9a888ccd43db01693337241b92cc72bb2266..9e00b7f8d26bce18eb0cf8f8491c67d3f5ffd950 100644 (file)
@@ -3,7 +3,7 @@
 # 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
index 758a4a2f1295cdfb6211d086e78c0876aacad13c..188f4bd196c196215f1d2a6b85714543b5958d57 100644 (file)
@@ -259,13 +259,27 @@ void caldav_report_one_item(struct http_transaction *h, struct ctdlsession *c, S
 
 // 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 ?",
index d99877c89fd572edae3d24935d9448afaa097f95..8f0b4659d8477e638739cc0fdcda7498da984ad5 100644 (file)
@@ -1,7 +1,7 @@
 // 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.
 
@@ -82,7 +82,7 @@ void extract_charset_from_meta(char *charset, char *meta_http_equiv, char *meta_
 // 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;
@@ -114,7 +114,7 @@ StrBuf *html2html(const char *supplied_charset, int treat_as_wiki, char *roomnam
                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);
index b4ecd4b2fa59fd1a827ef7abc7c6aa466960fd6c..1f96a4d06ca2f1dc924d9338fb86094170794d0a 100644 (file)
@@ -8,7 +8,7 @@
 
 
 // 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();
index 916c4e1f0b50a3445b4f66dcb2e6c96835f6ce6b..f3ce6d356ee5489b07543f7b594bf398d87aa39e 100644 (file)
@@ -305,4 +305,3 @@ char *http_datestring(time_t);
 void spawn_another_worker_thread(int *);
 void worker_entry(int *);
 int webserver(char *, int, int);
-