Full identifiers for Autocomplete, less confusing

This commit is contained in:
Mikael Nordfeldth 2015-12-05 16:18:59 +01:00
parent 376d545082
commit 4fecda58ff
1 changed files with 12 additions and 6 deletions

View File

@ -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');
}