From: Steve Brokenshire Date: Sun, 5 Jun 2016 22:38:43 +0000 (+0100) Subject: Added ATTENDEE property for saving data from a CalendarJournalObject. X-Git-Tag: release-0.02~185 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=8ea330744959e793cf0cc93fa9b3d0793a26ea20;p=xestiacalendar%2F.git Added ATTENDEE property for saving data from a CalendarJournalObject. Added the code and unit tests for the ATTENDEE property. --- diff --git a/source/objects/calendarjournal/CalendarJournal-Save.cpp b/source/objects/calendarjournal/CalendarJournal-Save.cpp index 39789b4..269f97b 100644 --- a/source/objects/calendarjournal/CalendarJournal-Save.cpp +++ b/source/objects/calendarjournal/CalendarJournal-Save.cpp @@ -466,6 +466,120 @@ void CalendarJournalObject::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:VJOURNAL\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaljournalsave.h b/source/tests/xestiacalendar_icaljournalsave.h index 69a7986..a0d00ae 100644 --- a/source/tests/xestiacalendar_icaljournalsave.h +++ b/source/tests/xestiacalendar_icaljournalsave.h @@ -84,6 +84,12 @@ TEST(iCalendarSaveJournal, SaveEventTests){ " l\n" "ATTACH;FMTTYPE=text/plain;VALUE=BINARY;ENCODING=BASE64;STUPID=EXAMPLE:VGhpcyB\n" " pcyBhbiBleGFtcGxlIGZpbGU=\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:VJOURNAL\n" "END:VCALENDAR";