]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Say until when the reviewers are away
authorvrana <jakubv@fb.com>
Fri, 18 May 2012 17:27:44 +0000 (10:27 -0700)
committervrana <jakubv@fb.com>
Sat, 19 May 2012 20:11:54 +0000 (13:11 -0700)
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

index 86ea239401b2ec079e463d04468b56a3aea4c75f..d42079b3270b1a735eac5529e939dad85e128ebc 100644 (file)
@@ -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.');