mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Try using a less-rich but less-risky thread title in Conpherence handles
Summary: Ref T8478. This is easier than I thought, let's see if it's conspicious? Test Plan: - Embedded `{Z2}` and saw "Private Correspondence". - Still saw normal stuff with useful participant lists/titles in all main UIs. Reviewers: btrahan Reviewed By: btrahan Subscribers: epriestley Maniphest Tasks: T8478 Differential Revision: https://secure.phabricator.com/D13220
This commit is contained in:
parent
7015520b93
commit
5397779ee2
2 changed files with 18 additions and 3 deletions
|
@ -19,9 +19,7 @@ final class PhabricatorConpherenceThreadPHIDType extends PhabricatorPHIDType {
|
|||
protected function buildQueryForObjects(
|
||||
PhabricatorObjectQuery $query,
|
||||
array $phids) {
|
||||
|
||||
return id(new ConpherenceThreadQuery())
|
||||
->needParticipantCache(true)
|
||||
->withPHIDs($phids);
|
||||
}
|
||||
|
||||
|
@ -33,7 +31,7 @@ final class PhabricatorConpherenceThreadPHIDType extends PhabricatorPHIDType {
|
|||
foreach ($handles as $phid => $handle) {
|
||||
$thread = $objects[$phid];
|
||||
|
||||
$title = $thread->getDisplayTitle($query->getViewer());
|
||||
$title = $thread->getStaticTitle();
|
||||
$monogram = $thread->getMonogram();
|
||||
|
||||
$handle->setName($title);
|
||||
|
|
|
@ -199,6 +199,23 @@ final class ConpherenceThread extends ConpherenceDAO
|
|||
return PhabricatorUser::getDefaultProfileImageURI();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a thread title which doesn't require handles to be attached.
|
||||
*
|
||||
* This is a less rich title than @{method:getDisplayTitle}, but does not
|
||||
* require handles to be attached. We use it to build thread handles without
|
||||
* risking cycles or recursion while querying.
|
||||
*
|
||||
* @return string Lower quality human-readable title.
|
||||
*/
|
||||
public function getStaticTitle() {
|
||||
$title = $this->getTitle();
|
||||
if (strlen($title)) {
|
||||
return $title;
|
||||
}
|
||||
|
||||
return pht('Private Correspondence');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the thread's display title for a user.
|
||||
|
|
Loading…
Reference in a new issue