mirror of
https://we.phorge.it/source/phorge.git
synced 2025-04-01 15:08:14 +02:00
Send audit emails to more users
Summary: Audit has some weird rules about who gets email. Make them less weird: - When a user does "Add Auditors", email the auditors. - When a commit is commented on, email anyone in "concern" or "audit required" states. @staticshock, my claim that I can't reproduce was crazy, I just have weird test data and read it wrong. Test Plan: Added a user to an audit and verified they got an email. Reviewers: btrahan, chad Reviewed By: btrahan CC: staticshock, aran Differential Revision: https://secure.phabricator.com/D6414
This commit is contained in:
parent
c977168797
commit
d467c49a66
1 changed files with 16 additions and 7 deletions
|
@ -419,7 +419,7 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
|
||||||
|
|
||||||
$author_phid = $data->getCommitDetail('authorPHID');
|
$author_phid = $data->getCommitDetail('authorPHID');
|
||||||
if ($author_phid) {
|
if ($author_phid) {
|
||||||
$email_to[] = $author_phid;
|
$email_to[$author_phid] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($other_comments as $other_comment) {
|
foreach ($other_comments as $other_comment) {
|
||||||
|
@ -427,13 +427,22 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($requests as $request) {
|
foreach ($requests as $request) {
|
||||||
if ($request->getAuditStatus() == PhabricatorAuditStatusConstants::CC) {
|
switch ($request->getAuditStatus()) {
|
||||||
|
case PhabricatorAuditStatusConstants::CC:
|
||||||
|
case PhabricatorAuditStatusConstants::AUDIT_REQUIRED:
|
||||||
$email_cc[$request->getAuditorPHID()] = true;
|
$email_cc[$request->getAuditorPHID()] = true;
|
||||||
} else if ($request->getAuditStatus() ==
|
break;
|
||||||
PhabricatorAuditStatusConstants::RESIGNED) {
|
case PhabricatorAuditStatusConstants::RESIGNED:
|
||||||
unset($email_cc[$request->getAuditorPHID()]);
|
unset($email_cc[$request->getAuditorPHID()]);
|
||||||
|
break;
|
||||||
|
case PhabricatorAuditStatusConstants::CONCERNED:
|
||||||
|
case PhabricatorAuditStatusConstants::AUDIT_REQUESTED:
|
||||||
|
$email_to[$request->getAuditorPHID()] = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$email_to = array_keys($email_to);
|
||||||
$email_cc = array_keys($email_cc);
|
$email_cc = array_keys($email_cc);
|
||||||
|
|
||||||
$phids = array_merge($email_to, $email_cc);
|
$phids = array_merge($email_to, $email_cc);
|
||||||
|
|
Loading…
Add table
Reference in a new issue