1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

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
This commit is contained in:
Bob Trahan 2013-07-03 16:46:33 -07:00
parent 2c03cd931b
commit 63250b2413

View file

@ -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])) {