@@ -391,9 +391,9 @@ bool get_freebusy(const char *username, const char *dir, time_t start_time,
391391
392392 uint32_t proptag_buff[] = {
393393 ptag.apptstartwhole , ptag.apptendwhole , ptag.busystatus ,
394- ptag.recurring , ptag.apptrecur , ptag. apptsubtype , ptag.private_flag ,
394+ ptag.recurring , ptag.apptsubtype , ptag.private_flag ,
395395 ptag.apptstateflags , ptag.location , ptag.reminderset ,
396- ptag. globalobjectid , ptag. timezonestruct , PR_SUBJECT ,
396+ PR_SUBJECT, PidTagMid ,
397397 };
398398 const PROPTAG_ARRAY proptags = {std::size (proptag_buff), deconst (proptag_buff)};
399399 TARRAY_SET rows;
@@ -402,8 +402,14 @@ bool get_freebusy(const char *username, const char *dir, time_t start_time,
402402 return false ;
403403
404404 for (size_t i = 0 ; i < rows.count ; ++i) {
405+ message_content *ctnt = nullptr ;
406+ auto msgid = rows.pparray [i]->get <const uint64_t >(PidTagMid);
407+ if (msgid == nullptr )
408+ continue ;
409+ if (!exmdb_client::read_message (dir, nullptr , CP_ACP, *msgid, &ctnt))
410+ continue ;
405411 std::string uid_buf;
406- if (!goid_to_icaluid (rows. pparray [i]-> get <BINARY>(ptag.globalobjectid ), uid_buf))
412+ if (!goid_to_icaluid (ctnt-> proplist . get <BINARY>(ptag.globalobjectid ), uid_buf))
407413 continue ;
408414 auto ts = rows.pparray [i]->get <const uint64_t >(ptag.apptstartwhole );
409415 if (ts == nullptr )
@@ -434,7 +440,7 @@ bool get_freebusy(const char *username, const char *dir, time_t start_time,
434440 // recurring appointments
435441 EXT_PULL ext_pull;
436442 std::optional<ical_component> tzcom;
437- auto bin = rows. pparray [i]-> get <BINARY>(ptag.timezonestruct );
443+ auto bin = ctnt-> proplist . get <BINARY>(ptag.timezonestruct );
438444 if (bin != nullptr ) {
439445 TIMEZONESTRUCT tz;
440446 ext_pull.init (bin->pb , bin->cb , exmdb_rpc_alloc, EXT_FLAG_UTF16);
@@ -445,7 +451,7 @@ bool get_freebusy(const char *username, const char *dir, time_t start_time,
445451 continue ;
446452 }
447453
448- bin = rows. pparray [i]-> get <BINARY>(ptag.apptrecur );
454+ bin = ctnt-> proplist . get <BINARY>(ptag.apptrecur );
449455 if (bin == nullptr )
450456 continue ;
451457 APPOINTMENT_RECUR_PAT apprecurr;
0 commit comments