1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 08:42:41 +01:00

fix feed story publishing for audit comments

Summary: we need to make sure we should publish to the auditor in a given audit request. write some custom logic for this as it is subtly different than other things like CC.

Test Plan: repro from T2087 produced expected results. further, former auditors who resigned did not get feed stories published.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2087

Differential Revision: https://secure.phabricator.com/D3987
This commit is contained in:
Bob Trahan 2012-11-19 17:25:45 -08:00
parent 1e743c9138
commit b4758c765c

View file

@ -270,7 +270,25 @@ final class PhabricatorAuditCommentEditor extends PhabricatorEditor {
$commit->updateAuditStatus($requests);
$commit->save();
$this->publishFeedStory($comment, array_keys($audit_phids));
$feed_dont_publish_phids = array();
foreach ($requests as $request) {
$status = $request->getAuditStatus();
switch ($status) {
case PhabricatorAuditStatusConstants::RESIGNED:
case PhabricatorAuditStatusConstants::NONE:
case PhabricatorAuditStatusConstants::AUDIT_NOT_REQUIRED:
case PhabricatorAuditStatusConstants::CC:
$feed_dont_publish_phids[$request->getAuditorPHID()] = 1;
break;
default:
unset($feed_dont_publish_phids[$request->getAuditorPHID()]);
break;
}
}
$feed_dont_publish_phids = array_keys($feed_dont_publish_phids);
$feed_phids = array_diff($requests_phids, $feed_dont_publish_phids);
$this->publishFeedStory($comment, $feed_phids);
PhabricatorSearchCommitIndexer::indexCommit($commit);
$this->sendMail($comment, $other_comments, $inline_comments, $requests);
}