1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-01-11 07:11:03 +01:00

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
This commit is contained in:
vrana 2012-05-18 10:27:44 -07:00
parent a5c6f32a06
commit d23d2df7e1

View 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.');