Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added VALARM:ATTENDEE property for saving data from a CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 22:20:20 +0000 (23:20 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sat, 4 Jun 2016 22:20:20 +0000 (23:20 +0100)
Added the code and unit tests for the VALARM:ATTENDEE property.

source/objects/calendarevent/CalendarEvent-Save.cpp
source/tests/xestiacalendar_icaleventsave.h

index 9e143ce..b511dc0 100644 (file)
@@ -1360,6 +1360,120 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                                
                        }
                        
+                       // Process the ATTENDEE VALARM values.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeList.size() > 0){
+               
+                               for (int AttendeeListSeek = 0; AttendeeListSeek < CalendarAlarmData[CalendarAlarmDataSeek].AttendeeList.size();
+                                       AttendeeListSeek++){
+       
+                                       DataLine += "ATTENDEE";
+
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListMember[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";MEMBER=\"";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListMember[AttendeeListSeek];
+                                               DataLine += "\"";
+                       
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListDelegatedFrom[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";DELEGATED-FROM=\"";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListDelegatedFrom[AttendeeListSeek];
+                                               DataLine += "\"";
+                       
+                                       }
+
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListDelegatedTo[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";DELEGATED-TO=\"";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListDelegatedTo[AttendeeListSeek];
+                                               DataLine += "\"";
+                       
+                                       }
+
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListRole[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";ROLE=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListRole[AttendeeListSeek];
+                       
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListRSVP[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";RSVP=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListRSVP[AttendeeListSeek];
+                       
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListDirectoryEntry[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";DIR=\"";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListDirectoryEntry[AttendeeListSeek];
+                                               DataLine += "\"";
+                       
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListSentBy[AttendeeListSeek].size() > 0){
+                               
+                                               DataLine += ";SENT-BY=\"";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListSentBy[AttendeeListSeek];
+                                               DataLine += "\"";
+                               
+                                       }
+
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListCommonName[AttendeeListSeek].size() > 0){
+                               
+                                               DataLine += ";CN=\"";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListCommonName[AttendeeListSeek];
+                                               DataLine += "\"";
+                               
+                                       }
+
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListCalendarUserType[AttendeeListSeek].size() > 0){
+                               
+                                               DataLine += ";CUTYPE=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListCalendarUserType[AttendeeListSeek];
+                               
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListParticipationStatus[AttendeeListSeek].size() > 0){
+                               
+                                               DataLine += ";PARTSTAT=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListParticipationStatus[AttendeeListSeek];
+                               
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListLanguage[AttendeeListSeek].size() > 0){
+                               
+                                               DataLine += ";LANGUAGE=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListLanguage[AttendeeListSeek];
+                               
+                                       }
+                       
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListTokens[AttendeeListSeek].size() > 0){
+               
+                                               DataLine += ";";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeListTokens[AttendeeListSeek];
+                       
+                                       }
+                               
+                                       DataLine += ":";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttendeeList[AttendeeListSeek];
+                                       DataLine += "\n";
+               
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                               
+                               }
+                       
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index b98907f..86710f5 100644 (file)
@@ -155,6 +155,12 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "SUMMARY;ALTREP=\"null:nodata\";LANGUAGE=en;MEEP=MOOP:This is the summary of the\n"
        "  third alarm.\n"
        "REPEAT;SLEEP=ALWAYS:PT3M\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:VALARM\n"
        "END:VEVENT\n"
        "END:VCARD";
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