Page MenuHomePhabricator

D10721.id25735.diff
No OneTemporary

D10721.id25735.diff

diff --git a/src/applications/audit/editor/PhabricatorAuditEditor.php b/src/applications/audit/editor/PhabricatorAuditEditor.php
--- a/src/applications/audit/editor/PhabricatorAuditEditor.php
+++ b/src/applications/audit/editor/PhabricatorAuditEditor.php
@@ -321,6 +321,7 @@
$object);
if ($request) {
$xactions[] = $request;
+ $this->setUnmentionablePHIDMap($request->getNewValue());
}
break;
default:
@@ -448,6 +449,84 @@
return true;
}
+ protected function expandCustomRemarkupBlockTransactions(
+ PhabricatorLiskDAO $object,
+ array $xactions,
+ $blocks,
+ PhutilMarkupEngine $engine) {
+
+ // we are only really trying to find unmentionable phids here...
+ // don't bother with this outside initial commit (i.e. create)
+ // transaction
+ $is_commit = false;
+ foreach ($xactions as $xaction) {
+ switch ($xaction->getTransactionType()) {
+ case PhabricatorAuditTransaction::TYPE_COMMIT:
+ $is_commit = true;
+ break;
+ }
+ }
+
+ // "result" is always an array....
+ $result = array();
+ if (!$is_commit) {
+ return $result;
+ }
+
+ $flat_blocks = array_mergev($blocks);
+ $huge_block = implode("\n\n", $flat_blocks);
+ $phid_map = array();
+ $phid_map[] = $this->getUnmentionablePHIDMap();
+
+ $task_map = array();
+ $task_refs = id(new ManiphestCustomFieldStatusParser())
+ ->parseCorpus($huge_block);
+ foreach ($task_refs as $match) {
+ foreach ($match['monograms'] as $monogram) {
+ $task_id = (int)trim($monogram, 'tT');
+ $task_map[$task_id] = true;
+ }
+ }
+
+ $rev_map = array();
+ $rev_refs = id(new DifferentialCustomFieldDependsOnParser())
+ ->parseCorpus($huge_block);
+ foreach ($rev_refs as $match) {
+ foreach ($match['monograms'] as $monogram) {
+ $rev_id = (int)trim($monogram, 'dD');
+ $rev_map[$rev_id] = true;
+ }
+ }
+
+ if ($task_map) {
+ $tasks = id(new ManiphestTaskQuery())
+ ->setViewer($this->getActor())
+ ->withIDs(array_keys($task_map))
+ ->execute();
+
+ if ($tasks) {
+ $phid_map[] = mpull($tasks, 'getPHID', 'getPHID');
+ }
+ }
+
+ if ($rev_map) {
+ $revs = id(new DifferentialRevisionQuery())
+ ->setViewer($this->getActor())
+ ->withIDs(array_keys($rev_map))
+ ->execute();
+
+ if ($revs) {
+ $phid_map[] = mpull($revs, 'getPHID', 'getPHID');
+ }
+
+ }
+ $phid_map = array_mergev($phid_map);
+ $this->setUnmentionablePHIDMap($phid_map);
+
+ return $result;
+ }
+
+
protected function shouldSendMail(
PhabricatorLiskDAO $object,
array $xactions) {

File Metadata

Mime Type
text/plain
Expires
Wed, Oct 23, 3:39 PM (2 w, 1 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6744589
Default Alt Text
D10721.id25735.diff (2 KB)

Event Timeline