]> code.citadel.org Git - citadel.git/blobdiff - webcit/groupdav_propfind.c
* Repaired pieces of the wiki engine that have fallen into disrepair.
[citadel.git] / webcit / groupdav_propfind.c
index b28cb636a6fc6ac9331da7a3fb2be86abd1e809d..2a2821f39938c2240c0afedd4a3a52b44277ca49 100644 (file)
@@ -6,8 +6,7 @@
  * A few notes about our XML output:
  *
  * --> Yes, we are spewing tags directly instead of using an XML library.
- *     If you would like to rewrite this using libxml2, code it up and submit
- *     a patch.  Whining will be summarily ignored.
+ *     Whining about it will be summarily ignored.
  *
  * --> XML is deliberately output with no whitespace/newlines between tags.
  *     This makes it difficult to read, but we have discovered clients which
@@ -74,7 +73,7 @@ void groupdav_collection_list(void)
        now = time(NULL);
        http_datestring(datestring, sizeof datestring, now);
 
-       /**
+       /*
         * Be rude.  Completely ignore the XML request and simply send them
         * everything we know about.  Let the client sort it out.
         */
@@ -90,8 +89,8 @@ void groupdav_collection_list(void)
                "<multistatus xmlns=\"DAV:\" xmlns:G=\"http://groupdav.org/\">"
        );
 
-       /**
-        *      If the client is requesting the root, show a root node.
+       /*
+        * If the client is requesting the root, show a root node.
         */
        if (starting_point == 0) {
                wprintf("<response>");
@@ -112,8 +111,8 @@ void groupdav_collection_list(void)
                wprintf("</response>");
        }
 
-       /**
-        *      If the client is requesting "/groupdav", show a /groupdav subdirectory.
+       /*
+        * If the client is requesting "/groupdav", show a /groupdav subdirectory.
         */
        if ((starting_point + WCC->Hdr->HR.dav_depth) >= 1) {
                wprintf("<response>");
@@ -134,8 +133,8 @@ void groupdav_collection_list(void)
                wprintf("</response>");
        }
 
-       /**
-        *      Now go through the list and make it look like a DAV collection
+       /*
+        * Now go through the list and make it look like a DAV collection
         */
        serv_puts("LKRA");
        serv_getln(buf, sizeof buf);
@@ -157,11 +156,13 @@ void groupdav_collection_list(void)
                 * GroupDAV calendar even if the user has switched it to a
                 * Calendar List view.
                 */
-               if ((view == VIEW_CALENDAR) || 
-                   (view == VIEW_TASKS) || 
-                   (view == VIEW_ADDRESSBOOK) ||
-                   (view == VIEW_NOTES) ||
-                   (view == VIEW_JOURNAL) ) {
+               if (    (view == VIEW_CALENDAR) || 
+                       (view == VIEW_TASKS) || 
+                       (view == VIEW_ADDRESSBOOK) ||
+                       (view == VIEW_NOTES) ||
+                       (view == VIEW_JOURNAL) ||
+                       (view == VIEW_WIKI)
+               ) {
                        is_groupware_collection = 1;
                }
                else {
@@ -201,6 +202,9 @@ void groupdav_collection_list(void)
                        case VIEW_JOURNAL:
                                wprintf("<G:vjournal-collection />");
                                break;
+                       case VIEW_WIKI:
+                               wprintf("<G:wiki-collection />");
+                               break;
                        }
 
                        wprintf("</resourcetype>");
@@ -258,10 +262,10 @@ void groupdav_propfind(void)
        }
 
        /* Go to the correct room. */
-       if (strcasecmp(ChrPtr(WC->wc_roomname), ChrPtr(dav_roomname))) {
+       if (strcasecmp(ChrPtr(WCC->wc_roomname), ChrPtr(dav_roomname))) {
                gotoroom(dav_roomname);
        }
-       if (strcasecmp(ChrPtr(WC->wc_roomname), ChrPtr(dav_roomname))) {
+       if (strcasecmp(ChrPtr(WCC->wc_roomname), ChrPtr(dav_roomname))) {
                hprintf("HTTP/1.1 404 not found\r\n");
                groupdav_common_headers();
                hprintf("Date: %s\r\n", datestring);
@@ -317,7 +321,7 @@ void groupdav_propfind(void)
                wprintf("<href>");
                groupdav_identify_host();
                wprintf("/groupdav/");
-               urlescputs(ChrPtr(WC->wc_roomname));
+               urlescputs(ChrPtr(WCC->wc_roomname));
                euid_escapize(encoded_uid, ChrPtr(dav_uid));
                wprintf("/%s", encoded_uid);
                wprintf("</href>");
@@ -363,24 +367,24 @@ void groupdav_propfind(void)
        );
 
 
-       /** Transmit the collection resource (FIXME check depth and starting point) */
+       /* Transmit the collection resource (FIXME check depth and starting point) */
        wprintf("<response>");
 
        wprintf("<href>");
-               groupdav_identify_host();
-               wprintf("/groupdav/");
-               urlescputs(ChrPtr(WC->wc_roomname));
+       groupdav_identify_host();
+       wprintf("/groupdav/");
+       urlescputs(ChrPtr(WCC->wc_roomname));
        wprintf("</href>");
 
        wprintf("<propstat>");
        wprintf("<status>HTTP/1.1 200 OK</status>");
        wprintf("<prop>");
        wprintf("<displayname>");
-       escputs(ChrPtr(WC->wc_roomname));
+       escputs(ChrPtr(WCC->wc_roomname));
        wprintf("</displayname>");
        wprintf("<resourcetype><collection/>");
 
-       switch(WC->wc_default_view) {
+       switch(WCC->wc_default_view) {
                case VIEW_CALENDAR:
                        wprintf("<G:vevent-collection />");
                        break;
@@ -402,9 +406,9 @@ void groupdav_propfind(void)
        wprintf("</propstat>");
        wprintf("</response>");
 
-       /** Transmit the collection listing (FIXME check depth and starting point) */
+       /* Transmit the collection listing (FIXME check depth and starting point) */
 
-       MsgNum = NewStrBuf ();
+       MsgNum = NewStrBuf();
        serv_puts("MSGS ALL");
 
        StrBuf_ServGetln(MsgNum);
@@ -436,11 +440,11 @@ void groupdav_propfind(void)
                                wprintf("<href>");
                                        groupdav_identify_host();
                                        wprintf("/groupdav/");
-                                       urlescputs(ChrPtr(WC->wc_roomname));
+                                       urlescputs(ChrPtr(WCC->wc_roomname));
                                        euid_escapize(encoded_uid, uid);
                                        wprintf("/%s", encoded_uid);
                                wprintf("</href>");
-                               switch(WC->wc_default_view) {
+                               switch(WCC->wc_default_view) {
                                case VIEW_CALENDAR:
                                        wprintf("<getcontenttype>text/x-ical</getcontenttype>");
                                        break;