Index: mainclientDll/src/cpp/dataTransformer.cpp =================================================================== --- mainclientDll/src/cpp/dataTransformer.cpp (revision 84) +++ mainclientDll/src/cpp/dataTransformer.cpp (working copy) @@ -41,10 +41,12 @@ #include "vocl/WinContact.h" #include "vocl/WinEvent.h" +#include "vocl/WinRecipient.h" #include "vocl/WinTask.h" #include "vocl/WinNote.h" #include "vocl/WinContactSIF.h" #include "vocl/WinEventSIF.h" +#include "vocl/WinRecipientSIF.h" #include "vocl/WinTaskSIF.h" #include "vocl/WinNoteSIF.h" @@ -56,6 +58,8 @@ #include +#include "time.h" + using namespace std; @@ -114,7 +118,7 @@ else item = new WinContact(data); } else if (itemType == APPOINTMENT) { - if (useSIF) item = new WinEventSIF(data, sifFields, (const WCHAR**)recurrenceFields); + if (useSIF) item = new WinEventSIF(data, sifFields, (const WCHAR**)recurrenceFields, (const WCHAR**)attendeeFields); else item = new WinEvent(data); } else if (itemType == TASK) { @@ -236,6 +240,24 @@ } } } + // Attendees added + /* Do it the not so good way, for now */ + std::list recipientCollection = cApp->getRecipientCollection(); + std::list::iterator it; + for(it=recipientCollection.begin();it != recipientCollection.end();it++) { + ClientRecipient cRec = *it; + WinRecipient *recip; + if (useSIF) { + recip = new WinRecipientSIF(); + } + recip->setAttendeeName(cRec.getName()); + recip->setAttendeeEmail(cRec.getAddress()); + if (useSIF) { + ((WinEventSIF *)winE)->addRecipient((WinRecipientSIF *)recip); + } else { + winE->addRecipient(recip); + } + } } else if (cItem->getType() == TASK) { @@ -332,7 +354,6 @@ */ int fillClientItem(const wstring& data, ClientItem* cItem, const wstring& itemType, const WCHAR* dataType) { - // If appointment, we clear the recurrence pattern (all fields are always sent). // Also appointment exceptions are removed here (if any). if (itemType == APPOINTMENT) { @@ -394,6 +415,19 @@ // Set events exceptions setRecurrenceExceptions(cItem, *(winE->getExcludeDates()), *(winE->getIncludeDates())); } + wstring recipientString = L""; + recipientList recipients = *winE->getRecipients(); + recipientList::iterator rit; + for(rit=recipients.begin(); rit != recipients.end(); rit++) { + WinRecipient recip = *rit; + //recipientString += recip.getAttendeeName()+L" <"+recip.getAttendeeEmail()+L">"; + recipientString += recip.getAttendeeName(); + recipientString += L";"; + } + if (recipientString.length() > 0) { + recipientString.erase(recipientString.end()-1); + } + cApp->setProperty(L"RequiredAttendees",recipientString); } else if (itemType == TASK) { @@ -418,7 +452,6 @@ if (winItem) { delete winItem; winItem = NULL; } - return 0; } Index: mainclientDll/src/cpp/outlook/ClientApplication.cpp =================================================================== --- mainclientDll/src/cpp/outlook/ClientApplication.cpp (revision 84) +++ mainclientDll/src/cpp/outlook/ClientApplication.cpp (working copy) @@ -330,7 +330,6 @@ // Set the COM pointer to the internal folder (overwrite past values) folder->setCOMPtr(pFolder, itemType); - return folder; error: @@ -1270,4 +1269,4 @@ return true; -} \ No newline at end of file +} Index: mainclientDll/src/cpp/outlook/ClientAppointment.cpp =================================================================== --- mainclientDll/src/cpp/outlook/ClientAppointment.cpp (revision 84) +++ mainclientDll/src/cpp/outlook/ClientAppointment.cpp (working copy) @@ -871,6 +871,22 @@ return cnew; } +std::list ClientAppointment::getRecipientCollection() { + std::list list; + // Iterate through the collection + + Redemption::ISafeRecipientsPtr recips = pSafeAppointment->GetRecipients(); + long recipientCount = recips->Count; + long l; + for (l=+1; lItem(l); + //recips.get_Item(*recip); + ClientRecipient *ctr = new ClientRecipient(); + ctr->setCOMPtr(recip); + list.push_back(*ctr); + } + return list; +} //void ClientAppointment::test() { // Index: mainclientDll/src/cpp/outlook/ClientRecipient.cpp =================================================================== --- mainclientDll/src/cpp/outlook/ClientRecipient.cpp (revision 0) +++ mainclientDll/src/cpp/outlook/ClientRecipient.cpp (revision 0) @@ -0,0 +1,28 @@ +#include "outlook/ClientRecipient.h" +#include "outlook/Defs.h" + +ClientRecipient::ClientRecipient() { + name = L""; + address = L""; +} +void ClientRecipient::setCOMPtr(Redemption::ISafeRecipientPtr& ptr) { + recipient = ptr; + name = (WCHAR *)recipient->Name; + if (recipient->Resolved) { + address = (WCHAR *)recipient->Address; + } +} +Redemption::ISafeRecipientPtr& ClientRecipient::getCOMPtr() { + return recipient; +} +ClientRecipient::~ClientRecipient() { +} +const std::wstring& ClientRecipient::getName() { + return name; +} +const std::wstring& ClientRecipient::getAddress() { + return address; +} +int ClientRecipient::getRecipientType() { + return recipientType; +} Index: mainclientDll/src/include/outlook/ClientAppointment.h =================================================================== --- mainclientDll/src/include/outlook/ClientAppointment.h (revision 84) +++ mainclientDll/src/include/outlook/ClientAppointment.h (working copy) @@ -43,7 +43,7 @@ #include "outlook/defs.h" #include "outlook/ClientItem.h" #include "outlook/ClientRecurrence.h" - +#include "outlook/ClientRecipient.h" #include @@ -132,6 +132,8 @@ DATE localStartDate; DATE localEndDate; + /// Generates and returns a collection of attendees (recipients in MAP parlance) + std::list getRecipientCollection(); }; Index: mainclientDll/src/include/outlook/ClientRecipient.h =================================================================== --- mainclientDll/src/include/outlook/ClientRecipient.h (revision 0) +++ mainclientDll/src/include/outlook/ClientRecipient.h (revision 0) @@ -0,0 +1,25 @@ +#ifndef INCL_CLIENTRECIPIENT +#define INCL_CLIENTRECIPIENT + +#include +#include "outlook/defs.h" +class ClientRecipient { +private: + Redemption::ISafeRecipientPtr recipient; +protected: + std::wstring name; + std::wstring address; + int recipientType; +public: + ClientRecipient(); + void setCOMPtr(Redemption::ISafeRecipientPtr& ptr); + Redemption::ISafeRecipientPtr& getCOMPtr(); + ~ClientRecipient(); + + const std::wstring& getName(); + const std::wstring& getAddress(); + int getRecipientType(); +}; + +#endif + Index: mainclientDll/src/include/SIFFields.h =================================================================== --- mainclientDll/src/include/SIFFields.h (revision 84) +++ mainclientDll/src/include/SIFFields.h (working copy) @@ -120,6 +120,16 @@ }; +////////////////////////////////////////////////////////////// +/// ATTENDEE FIELDS (inside ) +////////////////////////////////////////////////////////////// +static WCHAR* attendeeFields[] = { + {L"AttendeeName" }, + {L"AttendeeEmail" }, + {L"AttendeeType" }, + {L"AttendeeStatus" }, + {NULL} +}; @@ -177,6 +187,7 @@ {L"IMAddress" }, // Returns or sets a String that represents a contact's Microsoft Instant Messenger address. {L"Importance" }, // Returns or sets the relative importance level for the Outlook item. Can be one of the following OlImportance constants: olImportanceHigh(2), olImportanceLow(0), or olImportanceNormal(1). This property corresponds to the MAPI property PR_IMPORTANCE. {L"Initials" }, // Returns or sets the initials for the contact + {L"InternetFreeBusyAddress" }, // Internet FreeBusy address URL. {L"JobTitle" }, // Returns or sets the job title for the contact {L"Language" }, // Returns or sets the language for the contact {L"LastName" }, // Returns or sets the last name for the contact @@ -211,7 +222,7 @@ {L"YomiCompanyName" }, // Returns or sets a String indicating the Japanese phonetic rendering (yomigana) of the company name for the contact {L"YomiFirstName" }, // Returns or sets a String indicating the Japanese phonetic rendering (yomigana) of the first name for the contact {L"YomiLastName" }, // Returns or sets a String indicating the Japanese phonetic rendering (yomigana) of the last name for the contact - {L"FileAs" }, // Returns or sets the default keyword string assigned to the contact when it is filed + {L"FileAs" }, // Returns or sets the default keyword string assigned to the contact when it is filed }, {NULL} };