From 63250b241378038ffc59e32f6637d237019c952c Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Wed, 3 Jul 2013 16:46:33 -0700 Subject: [PATCH] Conpherence - make threads loadable as handles Summary: Fixes T3403 Test Plan: looked at /mail/ and saw sensible values as pertained to Conpherence threads. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Maniphest Tasks: T3403 Differential Revision: https://secure.phabricator.com/D6370 --- .../handle/PhabricatorObjectHandleData.php | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/applications/phid/handle/PhabricatorObjectHandleData.php b/src/applications/phid/handle/PhabricatorObjectHandleData.php index 80db253653..c9fd12129b 100644 --- a/src/applications/phid/handle/PhabricatorObjectHandleData.php +++ b/src/applications/phid/handle/PhabricatorObjectHandleData.php @@ -219,6 +219,14 @@ final class PhabricatorObjectHandleData { ->execute(); return mpull($legds, null, 'getPHID'); + case PhabricatorPHIDConstants::PHID_TYPE_CONP: + $confs = id(new ConpherenceThreadQuery()) + ->withPHIDs($phids) + ->setViewer($this->viewer) + ->execute(); + return mpull($confs, null, 'getPHID'); + + } return array(); @@ -738,7 +746,7 @@ final class PhabricatorObjectHandleData { $handle->setPHID($phid); $handle->setType($type); if (empty($objects[$phid])) { - $handle->setName('Unknown Legalpad Document'); + $handle->setName(pht('Unknown Legalpad Document')); } else { $document = $objects[$phid]; $handle->setName($document->getDocumentBody()->getTitle()); @@ -750,6 +758,29 @@ 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: $loader = null; if (isset($external_loaders[$type])) {