]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Full identifiers for Autocomplete, less confusing
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 5 Dec 2015 15:18:59 +0000 (16:18 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 5 Dec 2015 15:18:59 +0000 (16:18 +0100)
plugins/Autocomplete/actions/autocomplete.php

index 56df4eb6d8b6c205c2775745d33ab2297a01c238..d5370fe0e1e66eeaf383de3cf62fdaec58342c9b 100644 (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');
         }