From d23d2df7e1922b32b10cabd370c2aa1f0e046c83 Mon Sep 17 00:00:00 2001 From: vrana Date: Fri, 18 May 2012 10:27:44 -0700 Subject: [PATCH] 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 --- src/workflow/diff/ArcanistDiffWorkflow.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) 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.');