Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added code to process DISPLAY VALARMs in CalendarEventObject.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 14 Feb 2016 12:03:30 +0000 (12:03 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 14 Feb 2016 12:03:30 +0000 (12:03 +0000)
source/objects/calendarevent/CalendarEvent.cpp

index b12d6c9..b88a265 100644 (file)
@@ -1473,6 +1473,7 @@ void CalendarEventObject::ProcessData(){
                bool AlarmActionFound = false;
                bool AlarmTriggerFound = false;
                bool AlarmDurationFound = false;
+               bool AlarmDescriptionFound = false;
                        
                DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], 
                                &EventAlarmData[SeekCount], false, "ACTION");
@@ -1573,6 +1574,59 @@ void CalendarEventObject::ProcessData(){
                
                }
                
+               // Process the data from DESCRIPTION.
+               
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "DESCRIPTION");
+       
+               if (DataReceived.begin() != DataReceived.end() &&
+                       (NewAlarmData.AlarmType == CALENDARALARM_DISPLAY ||
+                       NewAlarmData.AlarmType == CALENDARALARM_EMAIL)){
+       
+                       bool TokenData = false;
+                       string PropertyTokens;
+               
+                       PropertyNameData = (string*)&DataReceived.begin()->first;
+               
+                       PropertyData = SplitValues(*PropertyNameData);
+               
+                       for(map<string,string>::iterator iter = PropertyData.begin();
+                               iter != PropertyData.end(); iter++){
+                       
+                               if (iter->first == "ALTREP"){
+                               
+                                       NewAlarmData.DescriptionAltRep = iter->second;
+                               
+                               } else if (iter->first == "LANGUAGE"){
+                               
+                                       NewAlarmData.DescriptionLanguage = iter->second;
+                               
+                               } else {
+                               
+                                       if (TokenData == false){
+                                               TokenData = true;
+                                       } else {
+                                               PropertyTokens += ";";
+                                       }
+                               
+                                       PropertyTokens += iter->first;
+                                       PropertyTokens += "=";
+                                       PropertyTokens += iter->second;
+                               
+                               }
+                               
+                       }
+               
+                       if (PropertyTokens.size() > 0){
+                               NewAlarmData.DescriptionTokens = PropertyTokens;
+                       }
+               
+                       NewAlarmData.DescriptionData = DataReceived.begin()->second;
+                       AlarmDescriptionFound = true;
+               
+               }
+               
+               // TODO: Implement SUMMARY.
+               
                // Process data from DURATION.
                
                DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "DURATION");
@@ -1643,6 +1697,13 @@ void CalendarEventObject::ProcessData(){
                
                        CalendarAlarmData.push_back(NewAlarmData);
                        
+               } else if (NewAlarmData.AlarmType == CALENDARALARM_DISPLAY &&
+                       AlarmActionFound == true &&
+                       AlarmTriggerFound == true &&
+                       AlarmDescriptionFound == true){
+
+                       CalendarAlarmData.push_back(NewAlarmData);
+                               
                }
                        
                SeekCount++;
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