1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-24 06:20:56 +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:
Bob Trahan 2014-10-17 13:55:39 -07:00
parent 9dd09f7171
commit 7a163ca654

View file

@ -462,18 +462,17 @@ final class PholioMockEditor extends PhabricatorApplicationTransactionEditor {
HeraldAdapter $adapter, HeraldAdapter $adapter,
HeraldTranscript $transcript) { HeraldTranscript $transcript) {
// TODO: Convert this to be transaction-based. $xactions = array();
$cc_phids = $adapter->getCcPHIDs(); $cc_phids = $adapter->getCcPHIDs();
if ($cc_phids) { if ($cc_phids) {
id(new PhabricatorSubscriptionsEditor()) $value = array_fuse($cc_phids);
->setObject($object) $xactions[] = id(new PholioTransaction())
->setActor($this->requireActor()) ->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
->subscribeImplicit($cc_phids) ->setNewValue(array('+' => $value));
->save();
} }
return array(); return $xactions;
} }
protected function sortTransactions(array $xactions) { protected function sortTransactions(array $xactions) {