Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14065654
D13177.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
5 KB
Referenced Files
None
Subscribers
None
D13177.diff
View Options
diff --git a/src/applications/differential/editor/DifferentialTransactionEditor.php b/src/applications/differential/editor/DifferentialTransactionEditor.php
--- a/src/applications/differential/editor/DifferentialTransactionEditor.php
+++ b/src/applications/differential/editor/DifferentialTransactionEditor.php
@@ -1558,9 +1558,6 @@
$object->getPHID(),
PhabricatorObjectHasUnsubscriberEdgeType::EDGECONST);
- $subscribed_phids = PhabricatorSubscribersQuery::loadSubscribersForPHID(
- $object->getPHID());
-
$revision = id(new DifferentialRevisionQuery())
->setViewer($this->getActor())
->withPHIDs(array($object->getPHID()))
@@ -1579,7 +1576,6 @@
$reviewers = $revision->getReviewerStatus();
$reviewer_phids = mpull($reviewers, 'getReviewerPHID');
- $adapter->setExplicitCCs($subscribed_phids);
$adapter->setExplicitReviewers($reviewer_phids);
$adapter->setForbiddenCCs($unsubscribed_phids);
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
@@ -196,6 +196,20 @@
return true;
case self::FIELD_IS_NEW_OBJECT:
return $this->getIsNewObject();
+ case self::FIELD_CC:
+ $object = $this->getObject();
+
+ if (!($object instanceof PhabricatorSubscribableInterface)) {
+ throw new Exception(
+ pht(
+ 'Adapter object (of class "%s") does not implement interface '.
+ '"%s", so the subscribers field value can not be determined.',
+ get_class($object),
+ 'PhabricatorSubscribableInterface'));
+ }
+
+ $phid = $object->getPHID();
+ return PhabricatorSubscribersQuery::loadSubscribersForPHID($phid);
case self::FIELD_APPLICATION_EMAIL:
$value = array();
// while there is only one match by implementation, we do set
diff --git a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
--- a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
+++ b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
@@ -5,7 +5,6 @@
protected $revision;
- protected $explicitCCs;
protected $explicitReviewers;
protected $forbiddenCCs;
@@ -110,11 +109,6 @@
return $object;
}
- public function setExplicitCCs($explicit_ccs) {
- $this->explicitCCs = $explicit_ccs;
- return $this;
- }
-
public function setExplicitReviewers($explicit_reviewers) {
$this->explicitReviewers = $explicit_reviewers;
return $this;
@@ -221,12 +215,6 @@
return mpull($projects, 'getPHID');
case self::FIELD_DIFF_FILE:
return $this->loadAffectedPaths();
- case self::FIELD_CC:
- if (isset($this->explicitCCs)) {
- return array_keys($this->explicitCCs);
- } else {
- return $this->revision->getCCPHIDs();
- }
case self::FIELD_REVIEWERS:
if (isset($this->explicitReviewers)) {
return array_keys($this->explicitReviewers);
@@ -297,19 +285,6 @@
assert_instances_of($effects, 'HeraldEffect');
$result = array();
- if ($this->explicitCCs) {
- $effect = new HeraldEffect();
- $effect->setAction(self::ACTION_ADD_CC);
- $effect->setTarget(array_keys($this->explicitCCs));
- $effect->setReason(
- pht(
- 'CCs provided explicitly by revision author or carried over '.
- 'from a previous version of the revision.'));
- $result[] = new HeraldApplyTranscript(
- $effect,
- true,
- pht('Added addresses to CC list.'));
- }
$forbidden_ccs = array_fill_keys(
nonempty($this->forbiddenCCs, array()),
diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
--- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
+++ b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
@@ -128,9 +128,6 @@
return $this->getTask()->getAuthorPHID();
case self::FIELD_ASSIGNEE:
return $this->getTask()->getOwnerPHID();
- case self::FIELD_CC:
- return PhabricatorSubscribersQuery::loadSubscribersForPHID(
- $this->getTask()->getPHID());
case self::FIELD_PROJECTS:
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getTask()->getPHID(),
diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
--- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php
+++ b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
@@ -101,9 +101,6 @@
return $this->getMock()->getDescription();
case self::FIELD_AUTHOR:
return $this->getMock()->getAuthorPHID();
- case self::FIELD_CC:
- return PhabricatorSubscribersQuery::loadSubscribersForPHID(
- $this->getMock()->getPHID());
case self::FIELD_PROJECTS:
return PhabricatorEdgeQuery::loadDestinationPHIDs(
$this->getMock()->getPHID(),
diff --git a/src/applications/phriction/herald/PhrictionDocumentHeraldAdapter.php b/src/applications/phriction/herald/PhrictionDocumentHeraldAdapter.php
--- a/src/applications/phriction/herald/PhrictionDocumentHeraldAdapter.php
+++ b/src/applications/phriction/herald/PhrictionDocumentHeraldAdapter.php
@@ -104,9 +104,6 @@
return $this->getDocument()->getContent()->getContent();
case self::FIELD_AUTHOR:
return $this->getDocument()->getContent()->getAuthorPHID();
- case self::FIELD_CC:
- return PhabricatorSubscribersQuery::loadSubscribersForPHID(
- $this->getDocument()->getPHID());
case self::FIELD_PATH:
return $this->getDocument()->getContent()->getSlug();
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 20, 5:45 AM (9 h, 10 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6728330
Default Alt Text
D13177.diff (5 KB)
Attached To
Mode
D13177: Consolidate "Subscribers" Herald field value logic
Attached
Detach File
Event Timeline
Log In to Comment