From 4fecda58ff1539f4ba249c9daad048eecfd255d4 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 5 Dec 2015 16:18:59 +0100 Subject: [PATCH] Full identifiers for Autocomplete, less confusing --- plugins/Autocomplete/actions/autocomplete.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/plugins/Autocomplete/actions/autocomplete.php b/plugins/Autocomplete/actions/autocomplete.php index 56df4eb6d8..d5370fe0e1 100644 --- a/plugins/Autocomplete/actions/autocomplete.php +++ b/plugins/Autocomplete/actions/autocomplete.php @@ -141,10 +141,13 @@ class AutocompleteAction extends Action $results = array(); foreach($this->profiles as $profile){ $avatarUrl = $profile->avatarUrl(AVATAR_MINI_SIZE); + $acct = $profile->getAcctUri(); + $identifier = split(':', $profile->getAcctUri(), 2)[1]; $results[] = array( - 'value' => '@'.$profile->nickname, - 'nickname' => $profile->nickname, - 'label'=> $profile->getFancyName(), + 'value' => '@'.$identifier, + 'nickname' => $profile->getNickname(), + 'acct_uri' => $acct, + 'label'=> "${identifier} (".$profile->getFullname().")", 'avatar' => $avatarUrl, 'type' => 'user' ); @@ -156,10 +159,13 @@ class AutocompleteAction extends Action } else { $avatarUrl = User_group::defaultLogo(AVATAR_MINI_SIZE); } + $acct = $profile->getAcctUri(); + $identifier = split(':', $profile->getAcctUri(), 2)[1]; $results[] = array( - 'value' => '!'.$group->nickname, - 'nickname' => $group->nickname, - 'label'=> $group->getFancyName(), + 'value' => '!'.$group->getNickname(), + 'nickname' => $group->getNickname(), + 'acct_uri' => $acct, + 'label'=> "${identifier} (".$group->getFullname().")", 'avatar' => $avatarUrl, 'type' => 'group'); }