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

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

index 940c557..5290574 100644 (file)
@@ -897,6 +897,52 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                
        }
        
+       // Process the CONTACT value.
+       
+       if (ContactList.size() > 0){
+               
+               for (int ContactListSeek = 0; ContactListSeek < ContactList.size();
+                       ContactListSeek++){
+       
+                       DataLine += "CONTACT";
+                       
+                       if (ContactListAltRep[ContactListSeek].size() > 0){
+               
+                               DataLine += ";ALTREP=\"";
+                               DataLine += ContactListAltRep[ContactListSeek];
+                               DataLine += "\"";
+                       
+                       }
+                               
+                       if (ContactListLanguage[ContactListSeek].size() > 0){
+               
+                               DataLine += ";LANGUAGE=";
+                               DataLine += ContactListLanguage[ContactListSeek];
+                       
+                       }
+                       
+                       if (ContactListTokens[ContactListSeek].size() > 0){
+               
+                               DataLine += ";";
+                               DataLine += ContactListTokens[ContactListSeek];
+                       
+                       }
+                               
+                       DataLine += ":";
+                       DataLine += ContactList[ContactListSeek];
+                       DataLine += "\n";
+               
+                       DataLineProcessed = OutputText(&DataLine);
+               
+                       *SaveData += DataLineProcessed;
+
+                       DataLine.clear();
+                       DataLineProcessed.clear();
+                               
+               }
+               
+       }
+       
        *SaveData += "END:VEVENT\n";
        
 }
\ No newline at end of file
index 06dd2a4..2824a5f 100644 (file)
@@ -113,6 +113,9 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "COMMENT:This is the first comment.\n"
        "COMMENT;ALTREP=\"null:nodata\";LANGUAGE=en:This is the second comment.\n"
        "COMMENT;ZEBRAS=YES:This is the third comment.\n"
+       "CONTACT:First Contact\n"
+       "CONTACT;ALTREP=\"null:nodata\";LANGUAGE=en-GB:Second Contact\n"
+       "CONTACT;ZEBRAS=NO:Third Contact\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