From 596db64ee62c645af77270ac8e95ecbe565e5eac Mon Sep 17 00:00:00 2001 From: Bob Trahan Date: Tue, 19 May 2015 13:20:04 -0700 Subject: [PATCH] Conpherence - make solo conversations be titled with viewer's name Summary: Fixes T8251. I think this used to be "lucky handle" when it was all one giant terrible function, so restore previous functionality and have the title be the viewer's name in this case. Test Plan: rocked a solo conpherence and saw my username as the title Reviewers: chad, epriestley Reviewed By: epriestley Subscribers: Korvin, epriestley Maniphest Tasks: T8251 Differential Revision: https://secure.phabricator.com/D12935 --- .../conpherence/storage/ConpherenceThread.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/applications/conpherence/storage/ConpherenceThread.php b/src/applications/conpherence/storage/ConpherenceThread.php index 8ed0e4fd18..36654713d5 100644 --- a/src/applications/conpherence/storage/ConpherenceThread.php +++ b/src/applications/conpherence/storage/ConpherenceThread.php @@ -231,9 +231,14 @@ final class ConpherenceThread extends ConpherenceDAO $handles = $this->getHandles(); $phids = $this->getOtherRecentParticipantPHIDs($viewer); - $limit = 3; - $more = (count($phids) > $limit); - $phids = array_slice($phids, 0, $limit); + if (count($phids) == 0) { + $phids[] = $viewer->getPHID(); + $more = false; + } else { + $limit = 3; + $more = (count($phids) > $limit); + $phids = array_slice($phids, 0, $limit); + } $names = array_select_keys($handles, $phids); $names = mpull($names, 'getName');