Solved P=NP
[citadel.git] / webcit-ng / server / caldav_reports.c
index f042c70311388b6194752a7f40a30374ef097af1..1c95c380652d39abfd84dbf2ab745f627aba7fcd 100644 (file)
@@ -224,7 +224,7 @@ void caldav_report(struct http_transaction *h, struct ctdlsession *c) {
        XML_Parse(xp, h->request_body, h->request_body_length, 1);
        XML_ParserFree(xp);
 
-       if (crp.Chardata != NULL) {     // Discard any trailing chardata ... normally nothing here
+       if (crp.Chardata != NULL) {             // Discard any trailing chardata ... normally nothing here
                FreeStrBuf(&crp.Chardata);
                crp.Chardata = NULL;
        }
@@ -258,10 +258,15 @@ void caldav_report(struct http_transaction *h, struct ctdlsession *c) {
                                StrBuf *one_item = fetch_ical(c, m);
                                icalcomponent *cal = icalcomponent_new_from_string(ChrPtr(one_item));
 
-                               // this is a horrible temporary hack to output every item
-                               int qualify = 1;
+                               // qualify will be set to nonzero if this calendar item is a match for the QUERY.
+                               int qualify = 0;
 
+                               // this is a horrible temporary hack to output every item (for now)
+                               qualify = 1;
+
+                               // Did this calendar item match the query?  If so, output it.
                                if (qualify) {
+                                       // FIXME need to populate the Href instead of NULL
                                        cal_multiget_out(m, NULL, one_item, ReportOut);
                                }