Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added ORGANIZER property for saving data from a CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 2 Jun 2016 21:28:19 +0000 (22:28 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 2 Jun 2016 21:28:19 +0000 (22:28 +0100)
Added the code and unit tests for the ORGANIZER property.

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

index 8f28931..2219f1a 100644 (file)
@@ -381,6 +381,62 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the ORGANIZER value.
+       
+       if (OrganiserData.size() > 0){
+               
+               DataLine += "ORGANIZER";
+               
+               if (OrganiserDataCommonName.size() > 0){
+               
+                       DataLine += ";CN=";
+                       DataLine += OrganiserDataCommonName;
+                       
+               }
+
+               if (OrganiserDataDirectoryEntry.size() > 0){
+               
+                       DataLine += ";DIR=\"";
+                       DataLine += OrganiserDataDirectoryEntry;
+                       DataLine += "\"";
+                       
+               }
+               
+               if (OrganiserDataSentByParam.size() > 0){
+               
+                       DataLine += ";SENT-BY=\"";
+                       DataLine += OrganiserDataSentByParam;                   
+                       DataLine += "\"";
+                       
+               }
+               
+               if (OrganiserDataLanguage.size() > 0){
+               
+                       DataLine += ";LANGUAGE=";
+                       DataLine += OrganiserDataLanguage;                      
+                       
+               }
+               
+               if (OrganiserDataTokens.size() > 0){
+               
+                       DataLine += ";";
+                       DataLine += OrganiserDataTokens;
+                       
+               }
+               
+               DataLine += ":";
+               DataLine += OrganiserData;
+               DataLine += "\n";
+               
+               DataLineProcessed = OutputText(&DataLine);
+               
+               *SaveData += DataLineProcessed;
+
+               DataLine.clear();
+               DataLineProcessed.clear();
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index b6c7576..247773f 100644 (file)
@@ -85,6 +85,8 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "GEO;EXAMPLE=MEEP:5.0;5.0\n"
        "LAST-MODIFIED;FUTURE=ODD:20160124T093000Z\n"
        "LOCATION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXACT=NO:The Basement, Truro\n"
+       "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n"
+       " eply@example.com\";LANGUAGE=kw;HAPPY=DAYS:mailto:organiser@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