Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Added code to process SUMMARY, ATTENDEE and ATTACH for VALARM
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 14 Feb 2016 14:26:27 +0000 (14:26 +0000)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 14 Feb 2016 14:26:27 +0000 (14:26 +0000)
source/objects/calendarevent/CalendarEvent.cpp

index b88a265..7b3e3e2 100644 (file)
@@ -1625,7 +1625,55 @@ void CalendarEventObject::ProcessData(){
                
                }
                
-               // TODO: Implement SUMMARY.
+               // Process data from SUMMARY.
+               
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], false, "SUMMARY");
+       
+               if (DataReceived.begin() != DataReceived.end() &&
+                       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.SummaryAltRep = iter->second;
+                               
+                               } else if (iter->first == "LANGUAGE"){
+                               
+                                       NewAlarmData.SummaryLanguage = iter->second;
+                               
+                               } else {
+                               
+                                       if (TokenData == false){
+                                               TokenData = true;
+                                       } else {
+                                               PropertyTokens += ";";
+                                       }
+                               
+                                       PropertyTokens += iter->first;
+                                       PropertyTokens += "=";
+                                       PropertyTokens += iter->second;
+                               
+                               }
+                               
+                       }
+               
+                       if (PropertyTokens.size() > 0){
+                               NewAlarmData.SummaryTokens = PropertyTokens;
+                       }
+               
+                       NewAlarmData.SummaryData = DataReceived.begin()->second;
+                       AlarmSummaryFound = true;
+               
+               }
                
                // Process data from DURATION.
                
@@ -1669,6 +1717,174 @@ void CalendarEventObject::ProcessData(){
                        
                }
                
+               // Process data from ATTENDEE.
+               
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], true, "ATTENDEE");
+       
+               ObjectSeekCount = 0;
+       
+               for(multimap<string,string>::iterator iter = DataReceived.begin(); 
+                       iter != DataReceived.end(); 
+                       ++iter){
+                       
+                       NewAlarmData.AttendeeListMember.push_back("");
+                       NewAlarmData.AttendeeListDelegatedFrom.push_back("");
+                       NewAlarmData.AttendeeListDelegatedTo.push_back("");
+                       NewAlarmData.AttendeeListRole.push_back("");
+                       NewAlarmData.AttendeeListRSVP.push_back("");
+                       NewAlarmData.AttendeeListDirectoryEntry.push_back("");
+                       NewAlarmData.AttendeeListSentBy.push_back("");
+                       NewAlarmData.AttendeeListCommonName.push_back("");
+                       NewAlarmData.AttendeeListCalendarUserType.push_back("");
+                       NewAlarmData.AttendeeListParticipationStatus.push_back("");
+                       NewAlarmData.AttendeeListLanguage.push_back("");
+                       NewAlarmData.AttendeeListTokens.push_back("");
+                       NewAlarmData.AttendeeList.push_back("");
+                       
+                       bool TokenData = false;
+                       string PropertyTokens;
+               
+                       PropertyNameData = (string*)&iter->first;
+               
+                       PropertyData = SplitValues(*PropertyNameData);
+                       
+                       for(map<string,string>::iterator dataiter = PropertyData.begin();
+                               dataiter != PropertyData.end(); dataiter++){
+                       
+                               if (dataiter->first == "CUTYPE"){
+                               
+                                       NewAlarmData.AttendeeListCalendarUserType[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "MEMBER"){
+                               
+                                       NewAlarmData.AttendeeListMember[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "ROLE"){
+                               
+                                       NewAlarmData.AttendeeListRole[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "PARTSTAT"){
+                               
+                                       NewAlarmData.AttendeeListParticipationStatus[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "RSVP"){
+                               
+                                       NewAlarmData.AttendeeListRSVP[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "DELEGATED-TO"){
+                               
+                                       NewAlarmData.AttendeeListDelegatedTo[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "DELEGATED-FROM"){
+                               
+                                       NewAlarmData.AttendeeListDelegatedFrom[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "SENT-BY"){
+                               
+                                       NewAlarmData.AttendeeListSentBy[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "CN"){
+                               
+                                       NewAlarmData.AttendeeListCommonName[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "DIR"){
+                               
+                                       NewAlarmData.AttendeeListDirectoryEntry[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "LANGUAGE"){
+                               
+                                       NewAlarmData.AttendeeListLanguage[ObjectSeekCount] = dataiter->second;
+                               
+                               } else {
+                               
+                                       if (TokenData == false){
+                                               TokenData = true;
+                                       } else {
+                                               PropertyTokens += ";";
+                                       }
+                               
+                                       PropertyTokens += dataiter->first;
+                                       PropertyTokens += "=";
+                                       PropertyTokens += dataiter->second;
+                               
+                               }
+                               
+                       }
+               
+                       if (PropertyTokens.size() > 0){
+                               NewAlarmData.AttendeeListTokens[ObjectSeekCount] = PropertyTokens;
+                       }
+                       
+                       NewAlarmData.AttendeeList[ObjectSeekCount] = iter->second;
+               
+                       ObjectSeekCount++;
+               
+               }
+               
+               // Process data from ATTACH.
+               
+               DataReceived = ProcessTextVectors(&EventAlarmName[SeekCount], &EventAlarmData[SeekCount], true, "ATTACH");
+       
+               ObjectSeekCount = 0;
+               
+               for(multimap<string,string>::iterator iter = DataReceived.begin(); 
+                       iter != DataReceived.end();
+                       ++iter){
+               
+                       NewAlarmData.AttachListEncoding.push_back("");
+                       NewAlarmData.AttachListValue.push_back("");
+                       NewAlarmData.AttachListFormatType.push_back("");
+                       NewAlarmData.AttachListTokens.push_back("");
+                       NewAlarmData.AttachList.push_back("");
+                       
+                       bool TokenData = false;
+                       string PropertyTokens;
+               
+                       PropertyNameData = (string*)&iter->first;
+               
+                       PropertyData = SplitValues(*PropertyNameData);
+                       
+                       for(map<string,string>::iterator dataiter = PropertyData.begin();
+                               dataiter != PropertyData.end(); dataiter++){
+                       
+                               if (dataiter->first == "ENCODING"){
+                               
+                                       NewAlarmData.AttachListEncoding[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "VALUE"){
+                               
+                                       NewAlarmData.AttachListValue[ObjectSeekCount] = dataiter->second;
+                               
+                               } else if (dataiter->first == "FMTTYPE"){
+                               
+                                       NewAlarmData.AttachListFormatType[ObjectSeekCount] = dataiter->second;
+                               
+                               } else {
+                               
+                                       if (TokenData == false){
+                                               TokenData = true;
+                                       } else {
+                                               PropertyTokens += ";";
+                                       }
+                               
+                                       PropertyTokens += dataiter->first;
+                                       PropertyTokens += "=";
+                                       PropertyTokens += dataiter->second;
+                               
+                               }
+                               
+                       }
+               
+                       if (PropertyTokens.size() > 0){
+                               NewAlarmData.AttachListTokens[ObjectSeekCount] = PropertyTokens;
+                       }
+                       
+                       NewAlarmData.AttachList[ObjectSeekCount] = iter->second;
+               
+                       ObjectSeekCount++;
+               
+               }
+               
                // Process data from X-*
                
                AlarmObjectCount = 0;
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