Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added ATTENDEE property for saving data from a CalendarFreeBusyObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 18:38:45 +0000 (19:38 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 5 Jun 2016 18:38:45 +0000 (19:38 +0100)
Added the code and unit tests for the ATTENDEE property.

source/objects/calendarfreebusy/CalendarFreeBusy-Save.cpp
source/tests/xestiacalendar_icalfreebusysave.h

index e60db34..71dfd35 100644 (file)
@@ -272,6 +272,120 @@ void CalendarFreeBusyObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the ATTENDEE value.
+       
+       if (AttendeeList.size() > 0){
+               
+               for (int AttendeeListSeek = 0; AttendeeListSeek < AttendeeList.size();
+                       AttendeeListSeek++){
+       
+                       DataLine += "ATTENDEE";
+
+                       if (AttendeeListMember[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";MEMBER=\"";
+                               DataLine += AttendeeListMember[AttendeeListSeek];
+                               DataLine += "\"";
+                       
+                       }
+                               
+                       if (AttendeeListDelegatedFrom[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";DELEGATED-FROM=\"";
+                               DataLine += AttendeeListDelegatedFrom[AttendeeListSeek];
+                               DataLine += "\"";
+                       
+                       }
+
+                       if (AttendeeListDelegatedTo[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";DELEGATED-TO=\"";
+                               DataLine += AttendeeListDelegatedTo[AttendeeListSeek];
+                               DataLine += "\"";
+                       
+                       }
+
+                       if (AttendeeListRole[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";ROLE=";
+                               DataLine += AttendeeListRole[AttendeeListSeek];
+                       
+                       }
+                       
+                       if (AttendeeListRSVP[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";RSVP=";
+                               DataLine += AttendeeListRSVP[AttendeeListSeek];
+                       
+                       }
+                       
+                       if (AttendeeListDirectoryEntry[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";DIR=\"";
+                               DataLine += AttendeeListDirectoryEntry[AttendeeListSeek];
+                               DataLine += "\"";
+                       
+                       }
+                       
+                       if (AttendeeListSentBy[AttendeeListSeek].size() > 0){
+                               
+                               DataLine += ";SENT-BY=\"";
+                               DataLine += AttendeeListSentBy[AttendeeListSeek];
+                               DataLine += "\"";
+                               
+                       }
+
+                       if (AttendeeListCommonName[AttendeeListSeek].size() > 0){
+                               
+                               DataLine += ";CN=\"";
+                               DataLine += AttendeeListCommonName[AttendeeListSeek];
+                               DataLine += "\"";
+                               
+                       }
+
+                       if (AttendeeListCalendarUserType[AttendeeListSeek].size() > 0){
+                               
+                               DataLine += ";CUTYPE=";
+                               DataLine += AttendeeListCalendarUserType[AttendeeListSeek];
+                               
+                       }
+                       
+                       if (AttendeeListParticipationStatus[AttendeeListSeek].size() > 0){
+                               
+                               DataLine += ";PARTSTAT=";
+                               DataLine += AttendeeListParticipationStatus[AttendeeListSeek];
+                               
+                       }
+                       
+                       if (AttendeeListLanguage[AttendeeListSeek].size() > 0){
+                               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += AttendeeListLanguage[AttendeeListSeek];
+                               
+                       }
+                       
+                       if (AttendeeListTokens[AttendeeListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += AttendeeListTokens[AttendeeListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += AttendeeList[AttendeeListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+                       
+       }
+       
        *SaveData += "END:VFREEBUSY\n";
        
 }
\ No newline at end of file
index dd28e96..f953dc9 100644 (file)
@@ -66,6 +66,12 @@ TEST(iCalendarSaveFreeBusy, SaveFreeBusyTests){
        "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n"
        " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@example.com\n"
        "URL;EXTERNAL=YES:http://www.example.com/\n"
+       "ATTENDEE:Attendee One\n"
+       "ATTENDEE;DELEGATED-FROM=\"mailto:delegated.from@example.com\";DELEGATED-TO=\"mai\n"
+       " lto:delegated.to@example.com\";ROLE=CHAIR;RSVP=TRUE:Attendee Two\n"
+       "ATTENDEE;DIR=\"null:nodata\";SENT-BY=\"mailto:sent.by@example.com\";CN=\"Attendee \n"
+       " The Third\";CUTYPE=INDIVIDUAL;PARTSTAT=ACCEPTED;LANGUAGE=kw;EXAMPLE=DATA:Atte\n"
+       " ndee Three\n"
        "END:VFREEBUSY\n"
        "END:VCALENDAR";        
 
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