1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

DifferentialCommentEditor::alterReviewers is now aware of differential.allow-self-accept setting

Summary: This allows users to add a revision's author as reviewer according Differential configuration using the 'Leap Into Action' form.

Test Plan: Tested on local install.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T1885

Differential Revision: https://secure.phabricator.com/D3682
This commit is contained in:
Dereckson 2012-10-12 07:41:43 -07:00 committed by epriestley
parent b7b783d771
commit ce2c0543bf

View file

@ -645,10 +645,12 @@ final class DifferentialCommentEditor extends PhabricatorEditor {
$added_reviewers = $this->getAddedReviewers();
$removed_reviewers = $this->getRemovedReviewers();
$reviewer_phids = $revision->getReviewers();
$allow_self_accept = PhabricatorEnv::getEnvConfig(
'differential.allow-self-accept', false);
$reviewer_phids_map = array_fill_keys($reviewer_phids, true);
foreach ($added_reviewers as $k => $user_phid) {
if ($user_phid == $revision->getAuthorPHID()) {
if (!$allow_self_accept && $user_phid == $revision->getAuthorPHID()) {
unset($added_reviewers[$k]);
}
if (isset($reviewer_phids_map[$user_phid])) {