Show
Ignore:
Timestamp:
07/09/07 10:02:18 (2 years ago)
Author:
daboo
Message:

Some 4.1 changes. Mostly vCard/CardDAV and CalDAV scheduling support.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/branches/v4.1d1/Sources_Common/Calendar_Store/Protocols/CCalendarProtocol.cpp

    r19 r86  
    355355        if (dynamic_cast<CWebDAVCalendarClient*>(copy_it)) 
    356356                mClient = new CWebDAVCalendarClient(static_cast<const CWebDAVCalendarClient&>(*copy_it), this); 
     357        else if (dynamic_cast<CCalDAVCalendarClient*>(copy_it)) 
     358                mClient = new CCalDAVCalendarClient(static_cast<const CCalDAVCalendarClient&>(*copy_it), this); 
    357359        else if (dynamic_cast<CLocalCalendarClient*>(copy_it)) 
    358360                mClient = new CLocalCalendarClient(static_cast<const CLocalCalendarClient&>(*copy_it), this); 
     
    10801082                 
    10811083                // Step 3 
     1084                cdstrset matching_components; 
    10821085                for(cdstrvect::const_iterator iter = component_keys.begin(); iter != component_keys.end(); iter++) 
    10831086                { 
     
    11751178                        // Step 3.5 
    11761179                        if (!server_rurl.empty()) 
    1177                                 comps.erase(server_rurl); 
     1180                                matching_components.insert(server_rurl); 
    11781181                } 
    11791182                 
     
    11821185                for(cdstrmap::const_iterator iter = comps.begin(); iter != comps.end(); iter++) 
    11831186                { 
    1184                         rurls.push_back((*iter).first); 
     1187                        cdstrset::const_iterator found = matching_components.find((*iter).first); 
     1188                        if (found == matching_components.end()) 
     1189                                rurls.push_back((*iter).first); 
    11851190                } 
    11861191 
     
    15471552} 
    15481553 
     1554void CCalendarProtocol::GetScheduleInboxOutbox(cdstring& inboxURI, cdstring& outboxURI) 
     1555{ 
     1556        // Do nothing if not available 
     1557        if (!GetHasScheduling()) 
     1558                return; 
     1559 
     1560        // Must block 
     1561        cdmutex::lock_cdmutex _lock(_mutex); 
     1562 
     1563        // Verify its still active because mutex wait could have resulted in closure 
     1564        if (!IsLoggedOn()) 
     1565                return; 
     1566 
     1567        // Send command to server 
     1568        // Calendar will take care of recovery 
     1569        mClient->_GetScheduleInboxOutbox(mStoreRoot, inboxURI, outboxURI); 
     1570} 
     1571 
     1572void CCalendarProtocol::Schedule(const cdstring& outboxURI, 
     1573                                                                 const cdstring& originator, 
     1574                                                                 const cdstrvect& recipients, 
     1575                                                                 const iCal::CICalendar& cal, 
     1576                                                                 iCal::CITIPScheduleResultsList& results) 
     1577{ 
     1578        // Do nothing if not available 
     1579        if (!GetHasScheduling()) 
     1580                return; 
     1581 
     1582        // Must block 
     1583        cdmutex::lock_cdmutex _lock(_mutex); 
     1584 
     1585        // Verify its still active because mutex wait could have resulted in closure 
     1586        if (!IsLoggedOn()) 
     1587                return; 
     1588 
     1589        // Send command to server 
     1590        // Calendar will take care of recovery 
     1591        mClient->_Schedule(outboxURI, originator, recipients, cal, results); 
     1592} 
     1593 
     1594void CCalendarProtocol::GetFreeBusyCalendars(cdstrvect& calendars) 
     1595{ 
     1596        // Do nothing if not available 
     1597        if (!GetHasScheduling()) 
     1598                return; 
     1599         
     1600        // Must block 
     1601        cdmutex::lock_cdmutex _lock(_mutex); 
     1602         
     1603        // Verify its still active because mutex wait could have resulted in closure 
     1604        if (!IsLoggedOn()) 
     1605                return; 
     1606         
     1607        // Send command to server 
     1608        mClient->_GetFreeBusyCalendars(calendars); 
     1609} 
     1610 
     1611void CCalendarProtocol::SetFreeBusyCalendars(const cdstrvect& calendars) 
     1612{ 
     1613        // Do nothing if not available 
     1614        if (!GetHasScheduling()) 
     1615                return; 
     1616         
     1617        // Must block 
     1618        cdmutex::lock_cdmutex _lock(_mutex); 
     1619         
     1620        // Verify its still active because mutex wait could have resulted in closure 
     1621        if (!IsLoggedOn()) 
     1622                return; 
     1623         
     1624        // Send command to server 
     1625        mClient->_SetFreeBusyCalendars(calendars); 
     1626} 
     1627 
    15491628#pragma mark ____________________________Disconnected 
    15501629