Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleQuery.php
Show First 20 Lines • Show All 407 Lines • ▼ Show 20 Lines | foreach ($events as $event) { | ||||
$map[$invitee_phid][] = $event; | $map[$invitee_phid][] = $event; | ||||
} | } | ||||
} | } | ||||
foreach ($rebuild as $phid => $user) { | foreach ($rebuild as $phid => $user) { | ||||
$events = idx($map, $phid, array()); | $events = idx($map, $phid, array()); | ||||
// We loaded events with the omnipotent user, but want to shift them | |||||
// into the user's timezone before building the cache because they will | |||||
// be unavailable during their own local day. | |||||
foreach ($events as $event) { | |||||
$event->applyViewerTimezone($user); | |||||
} | |||||
$cursor = $min_range; | $cursor = $min_range; | ||||
if ($events) { | if ($events) { | ||||
// Find the next time when the user has no meetings. If we move forward | // Find the next time when the user has no meetings. If we move forward | ||||
// because of an event, we check again for events after that one ends. | // because of an event, we check again for events after that one ends. | ||||
while (true) { | while (true) { | ||||
foreach ($events as $event) { | foreach ($events as $event) { | ||||
$from = $event->getDateFromForCache(); | $from = $event->getDateFromForCache(); | ||||
$to = $event->getDateTo(); | $to = $event->getViewerDateTo(); | ||||
if (($from <= $cursor) && ($to > $cursor)) { | if (($from <= $cursor) && ($to > $cursor)) { | ||||
$cursor = $to; | $cursor = $to; | ||||
continue 2; | continue 2; | ||||
} | } | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |