Differential D16759 Diff 40368 src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/xaction/PhabricatorCalendarEventInviteTransaction.php
Show All 24 Lines | private function generateChangeMap($object, $new_value) { | ||||
$old = $this->generateOldValue($object); | $old = $this->generateOldValue($object); | ||||
$add = array_diff($new_value, $old); | $add = array_diff($new_value, $old); | ||||
$rem = array_diff($old, $new_value); | $rem = array_diff($old, $new_value); | ||||
$map = array(); | $map = array(); | ||||
foreach ($add as $phid) { | foreach ($add as $phid) { | ||||
$map[$phid] = $status_invited; | $map[$phid] = $status_invited; | ||||
} | } | ||||
foreach ($rem as $phid) { | foreach ($rem as $phid) { | ||||
$map[$phid] = $status_uninvited; | $map[$phid] = $status_uninvited; | ||||
} | } | ||||
// If we're creating this event and the actor is inviting themselves, | // If we're creating this event and the actor is inviting themselves, | ||||
// mark them as attending. | // mark them as attending. | ||||
if ($this->isNewObject()) { | if ($this->isNewObject()) { | ||||
$acting_phid = $this->getActingAsPHID(); | $acting_phid = $this->getActingAsPHID(); | ||||
if (isset($map[$acting_phid])) { | if (isset($map[$acting_phid])) { | ||||
$map[$acting_phid] = $status_attending; | $map[$acting_phid] = $status_attending; | ||||
▲ Show 20 Lines • Show All 139 Lines • Show Last 20 Lines |