Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14026624
D14575.id35268.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D14575.id35268.diff
View Options
diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/src/applications/herald/adapter/HeraldAdapter.php
@@ -29,6 +29,7 @@
private $contentSource;
private $isNewObject;
private $applicationEmail;
+ private $appliedTransactions = array();
private $queuedTransactions = array();
private $emailPHIDs = array();
private $forcedEmailPHIDs = array();
@@ -121,6 +122,36 @@
return !empty($applications);
}
+
+ /**
+ * Set the list of transactions which just took effect.
+ *
+ * These transactions are set by @{class:PhabricatorApplicationEditor}
+ * automatically, before it invokes Herald.
+ *
+ * @param list<PhabricatorApplicationTransaction> List of transactions.
+ * @return this
+ */
+ final public function setAppliedTransactions(array $xactions) {
+ assert_instances_of($xactions, 'PhabricatorApplicationTransaction');
+ $this->appliedTransactions = $xactions;
+ return $this;
+ }
+
+
+ /**
+ * Get a list of transactions which just took effect.
+ *
+ * When an object is edited normally, transactions are applied and then
+ * Herald executes. You can call this method to examine the transactions
+ * if you want to react to them.
+ *
+ * @return list<PhabricatorApplicationTransaction> List of transactions.
+ */
+ final public function getAppliedTransactions() {
+ return $this->appliedTransactions;
+ }
+
public function queueTransaction($transaction) {
$this->queuedTransactions[] = $transaction;
}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -2867,12 +2867,15 @@
PhabricatorLiskDAO $object,
array $xactions) {
- $adapter = $this->buildHeraldAdapter($object, $xactions);
- $adapter->setContentSource($this->getContentSource());
- $adapter->setIsNewObject($this->getIsNewObject());
+ $adapter = $this->buildHeraldAdapter($object, $xactions)
+ ->setContentSource($this->getContentSource())
+ ->setIsNewObject($this->getIsNewObject())
+ ->setAppliedTransactions($xactions);
+
if ($this->getApplicationEmail()) {
$adapter->setApplicationEmail($this->getApplicationEmail());
}
+
$xscript = HeraldEngine::loadAndApplyRules($adapter);
$this->setHeraldAdapter($adapter);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 1:50 AM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6731830
Default Alt Text
D14575.id35268.diff (2 KB)
Attached To
Mode
D14575: Pass recently applied transactions to HeraldAdapters
Attached
Detach File
Event Timeline
Log In to Comment