Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added code and unit tests to list calendars from the server.
[xestiacalendar/.git] / source / objects / CalDAV / CalDAV.cpp
index a34ca07..51a1ec6 100644 (file)
@@ -467,12 +467,8 @@ CalDAVCalendarList CalDAV::GetCalendars(){
        string CalendarHomeURI = "";
        CalendarHomeURI = GetCalendarHome(UserPrincipalURI);
        
-       cout << ServerData << endl;
-       
        string CalendarListURLAddress = BuildServerAddress(&ConnectionData, CalendarHomeURI);
        
-       cout << CalendarListURLAddress << endl;
-       
        string CalendarListRequest = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
        "<d:propfind xmlns:d=\"DAV:\" xmlns:cs=\"http://calendarserver.org/ns/\""
        " xmlns:c=\"urn:ietf:params:xml:ns:caldav\" xmlns:x0=\"http://apple.com/ns/ical/\">\n"
@@ -483,6 +479,7 @@ CalDAVCalendarList CalDAV::GetCalendars(){
        "  <x0:calendar-order />\n"
        "  <cs:getctag />\n"
        "  <c:supported-calendar-component-set />\n"
+       "  <c:calendar-description />\n"
        " </d:prop>\n"
        "</d:propfind>";
        
@@ -511,8 +508,6 @@ CalDAVCalendarList CalDAV::GetCalendars(){
        
        CURLcode ServerResult = curl_easy_perform(ConnectionHandle);
        
-       cout << ServerData << endl;
-       
        //ServerList = ProcessXMLCalendarList();
        
        // Restore the original settings.
@@ -524,6 +519,17 @@ CalDAVCalendarList CalDAV::GetCalendars(){
        curl_easy_setopt(ConnectionHandle, CURLOPT_READDATA, NULL);
        curl_easy_setopt(ConnectionHandle, CURLOPT_READFUNCTION, NULL);
        
+       // Process the received XML data into a list of calendars
+       // and locations.
+       
+       if (ServerResult != CURLE_OK){
+               
+               return ServerList;
+               
+       }
+       
+       ServerList = ProcessXMLCalendarList();
+       
        return ServerList;
        
 }
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy