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

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

index 0181d0a..d7251aa 100644 (file)
@@ -1026,6 +1026,44 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the RELATED-TO value.
+       
+       if (RelatedToData.size() > 0){
+               
+               for (int RequestToDataSeek = 0; RequestToDataSeek < RelatedToData.size();
+                       RequestToDataSeek++){
+       
+                       DataLine += "RELATED-TO";
+                       
+                       if (RelatedToDataRelationType[RequestToDataSeek].size() > 0){
+               
+                               DataLine += ";RELTYPE=";
+                               DataLine += RelatedToDataRelationType[RequestToDataSeek];
+                       
+                       }
+                       
+                       if (RelatedToDataTokens[RequestToDataSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += RelatedToDataTokens[RequestToDataSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += RelatedToData[RequestToDataSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index 8b851fc..d7794da 100644 (file)
@@ -123,6 +123,9 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "REQUEST-STATUS;LANGUAGE=en:3.42;Really big irrecoverable error caused by the \n"
        " user\n"
        "REQUEST-STATUS;USER=MISSING:3.7;Invalid calendar user\n"
+       "RELATED-TO:person.1@example.com\n"
+       "RELATED-TO;RELTYPE=PARENT:person.2@example.com\n"
+       "RELATED-TO;SCHOOL=MEETING:person.3@example.com\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