diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 8c6c45c326..226adfdc69 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -724,6 +724,7 @@ phutil_register_library_map(array( 'DiffusionAuditorsAddAuditorsHeraldAction' => 'applications/diffusion/herald/DiffusionAuditorsAddAuditorsHeraldAction.php', 'DiffusionAuditorsAddSelfHeraldAction' => 'applications/diffusion/herald/DiffusionAuditorsAddSelfHeraldAction.php', 'DiffusionAuditorsHeraldAction' => 'applications/diffusion/herald/DiffusionAuditorsHeraldAction.php', + 'DiffusionAuditorsSearchEngineAttachment' => 'applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php', 'DiffusionBlameConduitAPIMethod' => 'applications/diffusion/conduit/DiffusionBlameConduitAPIMethod.php', 'DiffusionBlameController' => 'applications/diffusion/controller/DiffusionBlameController.php', 'DiffusionBlameQuery' => 'applications/diffusion/query/blame/DiffusionBlameQuery.php', @@ -6843,6 +6844,7 @@ phutil_register_library_map(array( 'DiffusionAuditorsAddAuditorsHeraldAction' => 'DiffusionAuditorsHeraldAction', 'DiffusionAuditorsAddSelfHeraldAction' => 'DiffusionAuditorsHeraldAction', 'DiffusionAuditorsHeraldAction' => 'HeraldAction', + 'DiffusionAuditorsSearchEngineAttachment' => 'PhabricatorSearchEngineAttachment', 'DiffusionBlameConduitAPIMethod' => 'DiffusionQueryConduitAPIMethod', 'DiffusionBlameController' => 'DiffusionController', 'DiffusionBlameQuery' => 'DiffusionQuery', diff --git a/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php b/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php new file mode 100644 index 0000000000..a244241449 --- /dev/null +++ b/src/applications/diffusion/engineextension/DiffusionAuditorsSearchEngineAttachment.php @@ -0,0 +1,33 @@ +needAuditRequests(true); + } + + public function getAttachmentForObject($object, $data, $spec) { + $auditors = $object->getAudits(); + + $list = array(); + foreach ($auditors as $auditor) { + $list[] = array( + 'auditorPHID' => $auditor->getAuditorPHID(), + ); + } + + return array( + 'auditors' => $list, + ); + } + +} diff --git a/src/applications/repository/storage/PhabricatorRepositoryCommit.php b/src/applications/repository/storage/PhabricatorRepositoryCommit.php index 6870ca2025..f0c7d6abf8 100644 --- a/src/applications/repository/storage/PhabricatorRepositoryCommit.php +++ b/src/applications/repository/storage/PhabricatorRepositoryCommit.php @@ -945,7 +945,10 @@ final class PhabricatorRepositoryCommit } public function getConduitSearchAttachments() { - return array(); + return array( + id(new DiffusionAuditorsSearchEngineAttachment()) + ->setAttachmentKey('auditors'), + ); }