From: Steve Brokenshire Date: Sun, 14 Feb 2016 14:26:27 +0000 (+0000) Subject: Added code to process SUMMARY, ATTENDEE and ATTACH for VALARM X-Git-Tag: release-0.02~361 X-Git-Url: http://Server1/repobrowser/?a=commitdiff_plain;h=c1fba59390fa1c67aa9a6527fc031d4a6e2c5442;p=xestiacalendar%2F.git Added code to process SUMMARY, ATTENDEE and ATTACH for VALARM --- diff --git a/source/objects/calendarevent/CalendarEvent.cpp b/source/objects/calendarevent/CalendarEvent.cpp index b88a265..7b3e3e2 100644 --- a/source/objects/calendarevent/CalendarEvent.cpp +++ b/source/objects/calendarevent/CalendarEvent.cpp @@ -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::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::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::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::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::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;