mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 12:00:55 +01:00
Pholio - upgrade herald effects to use transactions
Summary: Ref T4484 Test Plan: Made a mock. Made a herald rule to subscribe a user if mock had a string in title. Edited mock to have said string. Observed user subscribed correctly. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T4484 Differential Revision: https://secure.phabricator.com/D10725
This commit is contained in:
parent
9dd09f7171
commit
7a163ca654
1 changed files with 6 additions and 7 deletions
|
@ -462,18 +462,17 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
|
|||
HeraldAdapter $adapter,
|
||||
HeraldTranscript $transcript) {
|
||||
|
||||
// TODO: Convert this to be transaction-based.
|
||||
$xactions = array();
|
||||
|
||||
$cc_phids = $adapter->getCcPHIDs();
|
||||
if ($cc_phids) {
|
||||
id(new PhabricatorSubscriptionsEditor())
|
||||
->setObject($object)
|
||||
->setActor($this->requireActor())
|
||||
->subscribeImplicit($cc_phids)
|
||||
->save();
|
||||
$value = array_fuse($cc_phids);
|
||||
$xactions[] = id(new PholioTransaction())
|
||||
->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
|
||||
->setNewValue(array('+' => $value));
|
||||
}
|
||||
|
||||
return array();
|
||||
return $xactions;
|
||||
}
|
||||
|
||||
protected function sortTransactions(array $xactions) {
|
||||
|
|
Loading…
Reference in a new issue