mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +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:
parent
b7b783d771
commit
ce2c0543bf
1 changed files with 3 additions and 1 deletions
|
@ -645,10 +645,12 @@ final class DifferentialCommentEditor extends PhabricatorEditor {
|
||||||
$added_reviewers = $this->getAddedReviewers();
|
$added_reviewers = $this->getAddedReviewers();
|
||||||
$removed_reviewers = $this->getRemovedReviewers();
|
$removed_reviewers = $this->getRemovedReviewers();
|
||||||
$reviewer_phids = $revision->getReviewers();
|
$reviewer_phids = $revision->getReviewers();
|
||||||
|
$allow_self_accept = PhabricatorEnv::getEnvConfig(
|
||||||
|
'differential.allow-self-accept', false);
|
||||||
|
|
||||||
$reviewer_phids_map = array_fill_keys($reviewer_phids, true);
|
$reviewer_phids_map = array_fill_keys($reviewer_phids, true);
|
||||||
foreach ($added_reviewers as $k => $user_phid) {
|
foreach ($added_reviewers as $k => $user_phid) {
|
||||||
if ($user_phid == $revision->getAuthorPHID()) {
|
if (!$allow_self_accept && $user_phid == $revision->getAuthorPHID()) {
|
||||||
unset($added_reviewers[$k]);
|
unset($added_reviewers[$k]);
|
||||||
}
|
}
|
||||||
if (isset($reviewer_phids_map[$user_phid])) {
|
if (isset($reviewer_phids_map[$user_phid])) {
|
||||||
|
|
Loading…
Reference in a new issue