From: vrana Date: Fri, 18 May 2012 17:27:44 +0000 (-0700) Subject: Say until when the reviewers are away X-Git-Tag: conduit-4~1 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=d23d2df7e1922b32b10cabd370c2aa1f0e046c83;p=arcanist.git Say until when the reviewers are away Test Plan: `arc diff` with reviewers away. Reviewers: btrahan, epriestley Reviewed By: epriestley CC: aran, epriestley Differential Revision: https://secure.phabricator.com/D2496 --- diff --git a/src/workflow/diff/ArcanistDiffWorkflow.php b/src/workflow/diff/ArcanistDiffWorkflow.php index 86ea2394..d42079b3 100644 --- a/src/workflow/diff/ArcanistDiffWorkflow.php +++ b/src/workflow/diff/ArcanistDiffWorkflow.php @@ -1539,18 +1539,20 @@ EOTEXT throw new ArcanistUsageException( "You can not be a reviewer for your own revision."); } else { - $statuses = $this->getConduit()->callMethodSynchronous( - 'user.getcurrentstatus', + $users = $this->getConduit()->callMethodSynchronous( + 'user.query', array( - 'userPHIDs' => $reviewers, + 'phids' => $reviewers, )); - foreach ($statuses as $key => $status) { - if ($status['status'] != 'away') { - unset($statuses[$key]); + $untils = array(); + foreach ($users as $user) { + if (idx($user, 'currentStatus') == 'away') { + $untils[] = $user['currentStatusUntil']; } } - if (count($statuses) == count($reviewers)) { - $confirm = "All reviewers are away. Continue anyway?"; + if (count($untils) == count($reviewers)) { + $until = date('l, M j Y', min($untils)); + $confirm = "All reviewers are away until {$until}. Continue anyway?"; if (!phutil_console_confirm($confirm)) { throw new ArcanistUsageException( 'Specify available reviewers and retry.');