diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index ebd59b101f..746c2c50eb 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -989,6 +989,7 @@ phutil_register_library_map(array( 'PhabricatorConfigTransaction' => 'applications/config/storage/PhabricatorConfigTransaction.php', 'PhabricatorConfigTransactionQuery' => 'applications/config/query/PhabricatorConfigTransactionQuery.php', 'PhabricatorConfigValidationException' => 'applications/config/exception/PhabricatorConfigValidationException.php', + 'PhabricatorConpherencePHIDTypeThread' => 'applications/conpherence/phid/PhabricatorConpherencePHIDTypeThread.php', 'PhabricatorContentSource' => 'applications/metamta/contentsource/PhabricatorContentSource.php', 'PhabricatorContentSourceView' => 'applications/metamta/contentsource/PhabricatorContentSourceView.php', 'PhabricatorController' => 'applications/base/controller/PhabricatorController.php', @@ -3004,6 +3005,7 @@ phutil_register_library_map(array( 'PhabricatorConfigTransaction' => 'PhabricatorApplicationTransaction', 'PhabricatorConfigTransactionQuery' => 'PhabricatorApplicationTransactionQuery', 'PhabricatorConfigValidationException' => 'Exception', + 'PhabricatorConpherencePHIDTypeThread' => 'PhabricatorPHIDType', 'PhabricatorContentSourceView' => 'AphrontView', 'PhabricatorController' => 'AphrontController', 'PhabricatorCoreConfigOptions' => 'PhabricatorApplicationConfigOptions', diff --git a/src/applications/conpherence/phid/PhabricatorConpherencePHIDTypeThread.php b/src/applications/conpherence/phid/PhabricatorConpherencePHIDTypeThread.php new file mode 100644 index 0000000000..5e360ad642 --- /dev/null +++ b/src/applications/conpherence/phid/PhabricatorConpherencePHIDTypeThread.php @@ -0,0 +1,49 @@ +withPHIDs($phids) + ->setViewer($query->getViewer()) + ->execute(); + } + + public function loadHandles( + PhabricatorHandleQuery $query, + array $handles, + array $objects) { + + foreach ($handles as $phid => $handle) { + $thread = $objects[$phid]; + $name = $thread->getTitle(); + if (!strlen($name)) { + $name = pht('[No Title]'); + } + $handle->setName($name); + $handle->setFullName($name); + $handle->setURI('/conpherence/'.$thread->getID().'/'); + } + } + +} diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php index 2d1f852cc2..ee2d1498bc 100644 --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -31,7 +31,7 @@ final class ConpherenceThread extends ConpherenceDAO public function generatePHID() { return PhabricatorPHID::generateNewPHID( - PhabricatorPHIDConstants::PHID_TYPE_CONP); + PhabricatorConpherencePHIDTypeThread::TYPECONST); } public function save() { diff --git a/src/applications/conpherence/storage/ConpherenceTransaction.php b/src/applications/conpherence/storage/ConpherenceTransaction.php index a910de32a8..4d05ea7bf4 100644 --- a/src/applications/conpherence/storage/ConpherenceTransaction.php +++ b/src/applications/conpherence/storage/ConpherenceTransaction.php @@ -10,7 +10,7 @@ final class ConpherenceTransaction extends PhabricatorApplicationTransaction { } public function getApplicationTransactionType() { - return PhabricatorPHIDConstants::PHID_TYPE_CONP; + return PhabricatorConpherencePHIDTypeThread::TYPECONST; } public function getApplicationTransactionCommentObject() { diff --git a/src/applications/phid/PhabricatorPHIDConstants.php b/src/applications/phid/PhabricatorPHIDConstants.php index d92dc9960d..73ac7c8cab 100644 --- a/src/applications/phid/PhabricatorPHIDConstants.php +++ b/src/applications/phid/PhabricatorPHIDConstants.php @@ -16,7 +16,6 @@ final class PhabricatorPHIDConstants { const PHID_TYPE_TOBJ = 'TOBJ'; const PHID_TYPE_BLOG = 'BLOG'; const PHID_TYPE_ANSW = 'ANSW'; - const PHID_TYPE_CONP = 'CONP'; const PHID_TYPE_ACNT = 'ACNT'; const PHID_TYPE_PDCT = 'PDCT'; const PHID_TYPE_PRCH = 'PRCH'; diff --git a/src/applications/phid/handle/PhabricatorObjectHandleData.php b/src/applications/phid/handle/PhabricatorObjectHandleData.php index 0f79312fda..414aef6020 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/PhabricatorObjectHandleData.php @@ -104,13 +104,6 @@ final class PhabricatorObjectHandleData { ->execute(); return mpull($posts, null, 'getPHID'); - case PhabricatorPHIDConstants::PHID_TYPE_CONP: - $confs = id(new ConpherenceThreadQuery()) - ->withPHIDs($phids) - ->setViewer($this->viewer) - ->execute(); - return mpull($confs, null, 'getPHID'); - } return array(); @@ -265,29 +258,6 @@ final class PhabricatorObjectHandleData { } break; - case PhabricatorPHIDConstants::PHID_TYPE_CONP: - foreach ($phids as $phid) { - $handle = new PhabricatorObjectHandle(); - $handle->setPHID($phid); - $handle->setType($type); - if (empty($objects[$phid])) { - $handle->setName(pht('Unknown Conpherence Thread')); - } else { - $thread = $objects[$phid]; - $name = $thread->getTitle(); - if (!strlen($name)) { - $name = pht('[No Title]'); - } - $handle->setName($name); - $handle->setFullName($name); - $handle->setURI('/conpherence/'.$thread->getID().'/'); - $handle->setComplete(true); - } - $handles[$phid] = $handle; - } - break; - - default: foreach ($phids as $phid) { $handle = new PhabricatorObjectHandle(); diff --git a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php index 5016d81d3f..beb50997a3 100644 --- a/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php +++ b/src/infrastructure/edges/constants/PhabricatorEdgeConfig.php @@ -159,7 +159,6 @@ final class PhabricatorEdgeConfig extends PhabricatorEdgeConstants { PhabricatorPHIDConstants::PHID_TYPE_BLOG => 'PhameBlog', PhabricatorPHIDConstants::PHID_TYPE_POST => 'PhamePost', PhabricatorPHIDConstants::PHID_TYPE_ANSW => 'PonderAnswer', - PhabricatorPHIDConstants::PHID_TYPE_CONP => 'ConpherenceThread', PhabricatorPHIDConstants::PHID_TYPE_ACNT => 'PhortuneAccount', PhabricatorPHIDConstants::PHID_TYPE_PRCH => 'PhortunePurchase', PhabricatorPHIDConstants::PHID_TYPE_CHRG => 'PhortuneCharge',