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

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

index b511dc0..f539944 100644 (file)
@@ -1474,6 +1474,58 @@ void CalendarEventObject::SaveObjectData(string *SaveData){
                        
                        }
                        
+                       // Process the ATTACH VALARM values.
+                       
+                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttachList.size() > 0){
+               
+                               for (int AttachListSeek = 0; AttachListSeek < CalendarAlarmData[CalendarAlarmDataSeek].AttachList.size();
+                                       AttachListSeek++){
+       
+                                       DataLine += "ATTACH";
+                                               
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttachListFormatType[AttachListSeek].size() > 0){
+               
+                                               DataLine += ";FMTTYPE=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttachListFormatType[AttachListSeek];
+                       
+                                       }
+                               
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttachListValue[AttachListSeek].size() > 0){
+               
+                                               DataLine += ";VALUE=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttachListValue[AttachListSeek];
+                       
+                                       }
+                               
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttachListEncoding[AttachListSeek].size() > 0){
+               
+                                               DataLine += ";ENCODING=";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttachListEncoding[AttachListSeek];
+                       
+                                       }
+                               
+                                       if (CalendarAlarmData[CalendarAlarmDataSeek].AttachListTokens[AttachListSeek].size() > 0){
+               
+                                               DataLine += ";";
+                                               DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttachListTokens[AttachListSeek];
+                       
+                                       }
+               
+                                       DataLine += ":";
+                                       DataLine += CalendarAlarmData[CalendarAlarmDataSeek].AttachList[AttachListSeek];
+                                       DataLine += "\n";
+               
+                                       DataLineProcessed = OutputText(&DataLine);
+               
+                                       *SaveData += DataLineProcessed;
+
+                                       DataLine.clear();
+                                       DataLineProcessed.clear();
+                                       
+                               }
+                               
+                       }
+                       
                        *SaveData += "END:VALARM\n";
                        
                }
index 86710f5..f2e4847 100644 (file)
@@ -137,6 +137,11 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "TRIGGER;RELATED=END;VALUE=DATE-TIME;PUSH=BUTTON:20160220T160000Z\n"
        "DURATION;FLYING=NO:PT5H\n"
        "REPEAT;NEVER=SLEEP:PT5M\n"
+       "ATTACH;FMTTYPE=application/internet-shortcut:http://www.example.com/\n"
+       "ATTACH;FMTTYPE=application/internet-shortcut:http://www.example.com/page2.htm\n"
+       " l\n"
+       "ATTACH;FMTTYPE=text/plain;VALUE=BINARY;ENCODING=BASE64;STUPID=EXAMPLE:VGhpcyB\n"
+       " pcyBhbiBleGFtcGxlIGZpbGU=\n"
        "END:VALARM\n"
        "BEGIN:VALARM\n"
        "ACTION;FLASHING=LIGHTS:DISPLAY\n"
@@ -161,6 +166,11 @@ TEST(iCalendarSaveEvent, SaveEventTests){
        "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"
+       "ATTACH;FMTTYPE=application/internet-shortcut:http://www.example.com/\n"
+       "ATTACH;FMTTYPE=application/internet-shortcut:http://www.example.com/page2.htm\n"
+       " l\n"
+       "ATTACH;FMTTYPE=text/plain;VALUE=BINARY;ENCODING=BASE64;STUPID=EXAMPLE:VGhpcyB\n"
+       " pcyBhbiBleGFtcGxlIGZpbGU=\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