diff --git a/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php b/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php --- a/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php +++ b/src/applications/people/event/PhabricatorPeopleHovercardEventListener.php @@ -31,10 +31,16 @@ ->setViewer($viewer) ->withIDs(array($user->getID())) ->needAvailability(true) + ->needProfile(true) ->executeOne(); $hovercard->setTitle($user->getUsername()); - $hovercard->setDetail($user->getRealName()); + $profile = $user->getUserProfile(); + $detail = $user->getRealName(); + if ($profile->getTitle()) { + $detail .= ' - '.$profile->getTitle().'.'; + } + $hovercard->setDetail($detail); if ($user->getIsDisabled()) { $hovercard->addField(pht('Account'), pht('Disabled')); @@ -52,6 +58,13 @@ pht('User Since'), phabricator_date($user->getDateCreated(), $viewer)); + if ($profile->getBlurb()) { + $hovercard->addField(pht('Blurb'), + id(new PhutilUTF8StringTruncator()) + ->setMaximumGlyphs(120) + ->truncateString($profile->getBlurb())); + } + $event->setValue('hovercard', $hovercard); } diff --git a/src/applications/people/storage/PhabricatorUser.php b/src/applications/people/storage/PhabricatorUser.php --- a/src/applications/people/storage/PhabricatorUser.php +++ b/src/applications/people/storage/PhabricatorUser.php @@ -396,6 +396,10 @@ return substr(PhabricatorHash::digest($vec), 0, $len); } + public function getUserProfile() { + return $this->assertAttached($this->profile); + } + public function attachUserProfile(PhabricatorUserProfile $profile) { $this->profile = $profile; return $this;