1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Use standard subscribers effects in Herald Adapter for tasks

Summary: Ref T8455. Use the standard effect in task rules, instead of a custom effect.

Test Plan: Wrote a Maniphest CC rule, updated a task, saw rule activate properly.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T8455

Differential Revision: https://secure.phabricator.com/D13182
This commit is contained in:
epriestley 2015-06-08 10:31:53 -07:00
parent ab5f7a868e
commit 1e918eecfa
2 changed files with 2 additions and 25 deletions

View file

@ -3,7 +3,6 @@
final class HeraldManiphestTaskAdapter extends HeraldAdapter {
private $task;
private $ccPHIDs = array();
private $assignPHID;
protected function newObject() {
@ -48,14 +47,6 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter {
return $this->task;
}
private function setCcPHIDs(array $cc_phids) {
$this->ccPHIDs = $cc_phids;
return $this;
}
public function getCcPHIDs() {
return $this->ccPHIDs;
}
public function setAssignPHID($assign_phid) {
$this->assignPHID = $assign_phid;
return $this;
@ -92,6 +83,7 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter {
return array_merge(
array(
self::ACTION_ADD_CC,
self::ACTION_REMOVE_CC,
self::ACTION_EMAIL,
self::ACTION_ASSIGN_TASK,
self::ACTION_NOTHING,
@ -101,6 +93,7 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter {
return array_merge(
array(
self::ACTION_ADD_CC,
self::ACTION_REMOVE_CC,
self::ACTION_EMAIL,
self::ACTION_FLAG,
self::ACTION_ASSIGN_TASK,
@ -148,15 +141,6 @@ final class HeraldManiphestTaskAdapter extends HeraldAdapter {
foreach ($effects as $effect) {
$action = $effect->getAction();
switch ($action) {
case self::ACTION_ADD_CC:
foreach ($effect->getTarget() as $phid) {
$this->ccPHIDs[] = $phid;
}
$result[] = new HeraldApplyTranscript(
$effect,
true,
pht('Added addresses to cc list.'));
break;
case self::ACTION_ASSIGN_TASK:
$target_array = $effect->getTarget();
$assign_phid = reset($target_array);

View file

@ -513,13 +513,6 @@ final class ManiphestTransactionEditor
$xactions = array();
$cc_phids = $adapter->getCcPHIDs();
if ($cc_phids) {
$xactions[] = id(new ManiphestTransaction())
->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS)
->setNewValue(array('+' => $cc_phids));
}
$assign_phid = $adapter->getAssignPHID();
if ($assign_phid) {
$xactions[] = id(new ManiphestTransaction())