* Created IsEmptyStr define to be used rather then using some weird strlen constructs
[citadel.git] / webcit / groupdav_propfind.c
index 8e6154d611e18f032f714ad6e2d182bd6a4a5479..6d3092ae87951ed75033acbe09b675abbdcba9b8 100644 (file)
@@ -251,7 +251,7 @@ void groupdav_propfind(char *dav_pathname, int dav_depth, char *dav_content_type
         * If the room name is blank, the client is requesting a
         * folder list.
         */
-       if (strlen(dav_roomname) == 0) {
+       if (IsEmptyStr(dav_roomname)) {
                groupdav_collection_list(dav_pathname, dav_depth);
                return;
        }
@@ -277,7 +277,7 @@ void groupdav_propfind(char *dav_pathname, int dav_depth, char *dav_content_type
         * a specific item in the room.  This is not valid GroupDAV, but
         * it is valid WebDAV.
         */
-       if (strlen(dav_uid) > 0) {
+       if (!IsEmptyStr(dav_uid)) {
 
                dav_msgnum = locate_message_by_uid(dav_uid);
                if (dav_msgnum < 0) {
@@ -310,7 +310,7 @@ void groupdav_propfind(char *dav_pathname, int dav_depth, char *dav_content_type
                );
 
                wprintf("<response>");
-
+               
                wprintf("<href>");
                groupdav_identify_host();
                wprintf("/groupdav/");
@@ -410,7 +410,7 @@ void groupdav_propfind(char *dav_pathname, int dav_depth, char *dav_content_type
                        }
                }
 
-               if (strlen(uid) > 0) {
+               if (!IsEmptyStr(uid)) {
                        wprintf("<response>");
                                wprintf("<href>");
                                        groupdav_identify_host();
@@ -419,6 +419,17 @@ void groupdav_propfind(char *dav_pathname, int dav_depth, char *dav_content_type
                                        euid_escapize(encoded_uid, uid);
                                        wprintf("/%s", encoded_uid);
                                wprintf("</href>");
+                               switch(WC->wc_default_view) {
+                               case VIEW_CALENDAR:
+                                       wprintf("<getcontenttype>text/x-ical</getcontenttype>");
+                                       break;
+                               case VIEW_TASKS:
+                                       wprintf("<getcontenttype>text/x-ical</getcontenttype>");
+                                       break;
+                               case VIEW_ADDRESSBOOK:
+                                       wprintf("<getcontenttype>text/x-vcard</getcontenttype>");
+                                       break;
+                               }
                                wprintf("<propstat>");
                                        wprintf("<status>HTTP/1.1 200 OK</status>");
                                        wprintf("<prop>");