From 1e918eecfaab134282cc3fa272097dda27544881 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 8 Jun 2015 10:31:53 -0700 Subject: [PATCH] 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 --- .../adapter/HeraldManiphestTaskAdapter.php | 20 ++----------------- .../editor/ManiphestTransactionEditor.php | 7 ------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php index 300f4eef1c..a84130095a 100644 --- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php +++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php @@ -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); diff --git a/src/applications/maniphest/editor/ManiphestTransactionEditor.php b/src/applications/maniphest/editor/ManiphestTransactionEditor.php index bad2ba4091..76a8c7f6f1 100644 --- a/src/applications/maniphest/editor/ManiphestTransactionEditor.php +++ b/src/applications/maniphest/editor/ManiphestTransactionEditor.php @@ -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())