]> code.citadel.org Git - citadel.git/blobdiff - citadel/server/modules/calendar/calendar_report.c
enabling http debugging because here comes caldav ugh
[citadel.git] / citadel / server / modules / calendar / calendar_report.c
index c9d7eb19967d29da9ae67eb7ee3b18f980585cbd..b5e52db19445ca112cad3962a49999264decff60 100644 (file)
 #include "serv_calendar.h"
 
 
-// CtdlForEachMessage callback for calendar_report()
-void calendar_report_backend(long msgnum, void *data) {
+// CtdlForEachMessage callback for calendar_query()
+void calendar_query_backend(long msgnum, void *data) {
        struct CtdlMessage *msg = NULL;
        struct ical_respond_data ird;
 
-       syslog(LOG_DEBUG, "calendar_report: calendar_report_backend(%ld)", msgnum);
+       syslog(LOG_DEBUG, "calendar_query: calendar_query_backend(%ld)", msgnum);
 
        // Look for the calendar event...
        msg = CtdlFetchMessage(msgnum, 1);
@@ -41,25 +41,26 @@ void calendar_report_backend(long msgnum, void *data) {
        if (ird.cal == NULL) return;            // If there was no calendar item in this message, do nothing else.
 
 
+       // This is where we need to perform our search reduction.
+
+
        char *ser = icalcomponent_as_ical_string_r(ird.cal);
        if (ser) {
-               size_t len = strlen(ser);
+               size_t len = strlen(ser);       // Output the object, ensuring it terminates with a newline.
                client_write(ser, len);
                if ( (len>0) && (ser[len-1] != '\n') ) {
-                       syslog(LOG_DEBUG, "last char was %d", ser[len]);
                        client_write(HKEY("\n"));
                }
                free(ser);
        }
 
-
        icalcomponent_free(ird.cal);            // Return the memory we got from the callback.
 }
 
 
 // Go through a calendar room and output calendar objects after applying caller specified filters.
 // It is intended as a data source for WebCit (both the UI and CalDAV)
-void calendar_report(void) {
+void calendar_query(void) {
        void *filter_rules;     // Don't know yet what form this will take
 
        // Only allow this operation if we're in a room containing a calendar or tasks view
@@ -76,11 +77,9 @@ void calendar_report(void) {
        CtdlForEachMessage(MSGS_ALL, 0, NULL,
                NULL,
                NULL,
-               calendar_report_backend,
+               calendar_query_backend,
                (void *) filter_rules
        );
 
        cprintf("000\n");
 }
-
-