@@ -1997,6 +1997,59 @@ void EWSContext::toContent(const std::string& dir, tCalendarItem& item, sShape&
19971997 shape.write (NtGlobalObjectId, TAGGED_PROPVAL{PT_BINARY, goid});
19981998 shape.write (NtCleanGlobalObjectId, TAGGED_PROPVAL{PT_BINARY, goid});
19991999 }
2000+
2001+ size_t recipients = (item.RequiredAttendees ? item.RequiredAttendees ->size () : 0 ) +
2002+ (item.OptionalAttendees ? item.OptionalAttendees ->size () : 0 ) +
2003+ (item.Resources ? item.Resources ->size () : 0 );
2004+ if (recipients) {
2005+ if (!content->children .prcpts && !(content->children .prcpts = tarray_set_init ()))
2006+ throw EWSError::NotEnoughMemory (E3288 );
2007+ TARRAY_SET* rcpts = content->children .prcpts ;
2008+ if (item.RequiredAttendees )
2009+ for (const auto &att : *item.RequiredAttendees )
2010+ att.Mailbox .mkRecipient (rcpts->emplace (), MAPI_TO);
2011+ if (item.OptionalAttendees )
2012+ for (const auto &att : *item.OptionalAttendees )
2013+ att.Mailbox .mkRecipient (rcpts->emplace (), MAPI_CC);
2014+ if (item.Resources )
2015+ for (const auto &att : *item.Resources )
2016+ att.Mailbox .mkRecipient (rcpts->emplace (), MAPI_TO);
2017+ std::string dispName;
2018+ if (!mysql_adaptor_get_user_displayname (m_auth_info.username , dispName))
2019+ throw DispatchError (E3302 );
2020+ auto displayName = deconst (dispName.c_str ());
2021+ shape.write (TAGGED_PROPVAL{PR_SENT_REPRESENTING_NAME, displayName});
2022+ shape.write (TAGGED_PROPVAL{PR_SENDER_NAME, displayName});
2023+ auto username = deconst (m_auth_info.username );
2024+ shape.write (TAGGED_PROPVAL{PR_SENT_REPRESENTING_SMTP_ADDRESS, username});
2025+ shape.write (TAGGED_PROPVAL{PR_SENDER_SMTP_ADDRESS, username});
2026+ auto addrType = deconst (" SMTP" );
2027+ shape.write (TAGGED_PROPVAL{PR_SENT_REPRESENTING_ADDRTYPE, addrType});
2028+ shape.write (TAGGED_PROPVAL{PR_SENDER_ADDRTYPE, addrType});
2029+ auto uint0 = construct<uint8_t >(0 );
2030+ auto uint1 = construct<uint32_t >(1 );
2031+ auto uint5 = construct<uint32_t >(5 );
2032+ shape.write (NtMeetingType, TAGGED_PROPVAL{PT_LONG, uint1});
2033+ shape.write (NtPrivate, TAGGED_PROPVAL{PT_BOOLEAN, uint0});
2034+ shape.write (NtAppointmentStateFlags, TAGGED_PROPVAL{PT_LONG, uint1});
2035+ shape.write (NtResponseStatus, TAGGED_PROPVAL{PT_LONG, uint5});
2036+ std::string essdn;
2037+ if (cvt_username_to_essdn (m_auth_info.username , m_plugin.x500_org_name .c_str (),
2038+ mysql_adaptor_get_user_ids, mysql_adaptor_get_domain_ids, essdn) != ecSuccess)
2039+ throw DispatchError (E3085 );
2040+ shape.write (TAGGED_PROPVAL{PR_SENT_REPRESENTING_EMAIL_ADDRESS, strcpy (alloc<char >(essdn.size () + 1 ), essdn.c_str ())});
2041+ shape.write (TAGGED_PROPVAL{PR_SENDER_EMAIL_ADDRESS, strcpy (alloc<char >(essdn.size () + 1 ), essdn.c_str ())});
2042+ EMSAB_ENTRYID abEid{0 , DT_MAILUSER, essdn.data ()};
2043+ EXT_PUSH ext_push;
2044+ static constexpr size_t ABEIDBUFFSIZE = 1280 ;
2045+ uint8_t * abEidBuff = alloc<uint8_t >(ABEIDBUFFSIZE);
2046+ if (!ext_push.init (abEidBuff, ABEIDBUFFSIZE, EXT_FLAG_UTF16) ||
2047+ ext_push.p_abk_eid (abEid) != pack_result::ok)
2048+ throw DispatchError (E3085 );
2049+ BINARY* abEidContainer = construct<BINARY>(BINARY{ext_push.m_offset , {abEidBuff}});
2050+ shape.write (TAGGED_PROPVAL{PR_SENT_REPRESENTING_ENTRYID, abEidContainer});
2051+ shape.write (TAGGED_PROPVAL{PR_SENDER_ENTRYID, abEidContainer});
2052+ }
20002053}
20012054
20022055/* *
@@ -2165,7 +2218,7 @@ void EWSContext::toContent(const std::string& dir, tItem& item, sShape& shape, M
21652218 if (item.Subject )
21662219 shape.write (TAGGED_PROPVAL{PR_SUBJECT, deconst (item.Subject ->c_str ())});
21672220
2168- auto now = EWSContext::construct<uint64_t >(rop_util_current_nttime ());
2221+ auto now = EWSContext::construct<mapitime_t >(rop_util_current_nttime ());
21692222 shape.write (TAGGED_PROPVAL{PR_CREATION_TIME, now});
21702223 shape.write (TAGGED_PROPVAL{PR_LOCAL_COMMIT_TIME, now});
21712224
@@ -2353,8 +2406,8 @@ void EWSContext::updated(const std::string& dir, const sMessageEntryId& mid, sSh
23532406 if (!m_plugin.exmdb .allocate_cn (dir.c_str (), &changeNum))
23542407 throw DispatchError (E3084 );
23552408 uint64_t localCommitTime = rop_util_current_nttime ();
2356- shape.write (TAGGED_PROPVAL{PR_LOCAL_COMMIT_TIME, construct<uint64_t >(localCommitTime)});
2357- shape.write (TAGGED_PROPVAL{PR_LAST_MODIFICATION_TIME, construct<uint64_t >(localCommitTime)});
2409+ shape.write (TAGGED_PROPVAL{PR_LOCAL_COMMIT_TIME, construct<mapitime_t >(localCommitTime)});
2410+ shape.write (TAGGED_PROPVAL{PR_LAST_MODIFICATION_TIME, construct<mapitime_t >(localCommitTime)});
23582411
23592412 std::string displayName;
23602413 if (mysql_adaptor_get_user_displayname (m_auth_info.username ,
0 commit comments