Skip to content

Commit 23dd44a

Browse files
committed
Do not add the organizer to the recipient list twice
References: Issue #134
1 parent 4a72c84 commit 23dd44a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

lib/grommunio/mapiprovider.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,7 +1739,6 @@ private function setAppointment($mapimessage, $appointment) {
17391739
$sentrepresentingemail = $abEntryProps[PR_EMAIL_ADDRESS] ?? $abEntryProps[PR_SMTP_ADDRESS] ?? $sentrepresentingemail;
17401740
$sentrepresentingaddt = $abEntryProps[PR_ADDRTYPE] ?? $sentrepresentingaddt;
17411741
}
1742-
17431742
$props[$appointmentprops["representingentryid"]] = $storeProps[PR_MAILBOX_OWNER_ENTRYID];
17441743
$props[$appointmentprops["representingname"]] = $displayname;
17451744
$props[$appointmentprops["sentrepresentingemail"]] = $sentrepresentingemail;
@@ -1816,13 +1815,16 @@ private function setAppointment($mapimessage, $appointment) {
18161815
$org[PR_SEARCH_KEY] = isset($representingprops[$appointmentprops["sentrepresentinsrchk"]]) ? $representingprops[$appointmentprops["sentrepresentinsrchk"]] : $props[$appointmentprops["sentrepresentinsrchk"]];
18171816
$org[PR_RECIPIENT_FLAGS] = recipOrganizer | recipSendable;
18181817
$org[PR_RECIPIENT_TYPE] = MAPI_ORIG;
1819-
1820-
array_push($recips, $org);
1821-
}
1818+
$org[PR_RECIPIENT_TRACKSTATUS] = olResponseOrganized;
1819+
if ($abEntryProps !== false && isset($abEntryProps[PR_SMTP_ADDRESS])) {
1820+
$org[PR_SMTP_ADDRESS] = $abEntryProps[PR_SMTP_ADDRESS];
1821+
}
18221822

1823-
// remove organizer from old_receips
1824-
if (isset($old_receips[$org[PR_EMAIL_ADDRESS]])) {
1825-
unset($old_receips[$org[PR_EMAIL_ADDRESS]]);
1823+
array_push($recips, $org);
1824+
// remove organizer from old_receips
1825+
if (isset($old_receips[$org[PR_EMAIL_ADDRESS]])) {
1826+
unset($old_receips[$org[PR_EMAIL_ADDRESS]]);
1827+
}
18261828
}
18271829

18281830
// Open address book for user resolve
@@ -1860,6 +1862,10 @@ private function setAppointment($mapimessage, $appointment) {
18601862
else {
18611863
$forceMRUpdateSend = true;
18621864
}
1865+
// the organizer is already in the recipient list, no need to add him again
1866+
if (isset($org[PR_EMAIL_ADDRESS]) && strcasecmp($org[PR_EMAIL_ADDRESS], $recip[PR_EMAIL_ADDRESS]) == 0) {
1867+
continue;
1868+
}
18631869
array_push($recips, $recip);
18641870
}
18651871

0 commit comments

Comments
 (0)