From e2a3b3d990c7171947b617b83285d5656b3ae477 Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Mon, 6 Jun 2016 22:10:08 +0100 Subject: [PATCH] Added ORGANIZER property for saving data from a CalendarTaskObject. Added the code and unit tests for the ORGANIZER property. --- .../calendartask/CalendarTask-Save.cpp | 56 +++++++++++++++++++ source/tests/xestiacalendar_icaltasksave.h | 2 + 2 files changed, 58 insertions(+) diff --git a/source/objects/calendartask/CalendarTask-Save.cpp b/source/objects/calendartask/CalendarTask-Save.cpp index 4c49018..9498b85 100644 --- a/source/objects/calendartask/CalendarTask-Save.cpp +++ b/source/objects/calendartask/CalendarTask-Save.cpp @@ -328,6 +328,62 @@ void CalendarTaskObject::SaveObjectData(string *SaveData){ } + // Process the ORGANIZER value. + + if (OrganiserData.size() > 0){ + + DataLine += "ORGANIZER"; + + if (OrganiserDataCommonName.size() > 0){ + + DataLine += ";CN="; + DataLine += OrganiserDataCommonName; + + } + + if (OrganiserDataDirectoryEntry.size() > 0){ + + DataLine += ";DIR=\""; + DataLine += OrganiserDataDirectoryEntry; + DataLine += "\""; + + } + + if (OrganiserDataSentByParam.size() > 0){ + + DataLine += ";SENT-BY=\""; + DataLine += OrganiserDataSentByParam; + DataLine += "\""; + + } + + if (OrganiserDataLanguage.size() > 0){ + + DataLine += ";LANGUAGE="; + DataLine += OrganiserDataLanguage; + + } + + if (OrganiserDataTokens.size() > 0){ + + DataLine += ";"; + DataLine += OrganiserDataTokens; + + } + + DataLine += ":"; + DataLine += OrganiserData; + DataLine += "\n"; + + DataLineProcessed = OutputText(&DataLine); + + *SaveData += DataLineProcessed; + + DataLine.clear(); + DataLineProcessed.clear(); + + } + *SaveData += "END:VTODO\n"; } \ No newline at end of file diff --git a/source/tests/xestiacalendar_icaltasksave.h b/source/tests/xestiacalendar_icaltasksave.h index fbe5341..76c359e 100644 --- a/source/tests/xestiacalendar_icaltasksave.h +++ b/source/tests/xestiacalendar_icaltasksave.h @@ -69,6 +69,8 @@ TEST(iCalendarSaveTask, SaveTaskTests){ "LAST-MODIFIED;FUTURE=EVEN:20160131T114200Z\n" "LOCATION;ALTREP=\"null:nodata\";LANGUAGE=kw;EXACT=YES:The Crystal Ceiling, Trur\n" " o\n" + "ORGANIZER;CN=ExampleOrganiser;DIR=\"null:nodata\";SENT-BY=\"mailto:organiser.nor\n" + " eply@example.com\";LANGUAGE=kw;HAPPY=WEEKS:mailto:organiser@example.com\n" "END:VTODO\n" "END:VCALENDAR"; -- 2.39.5