1
0
Fork 0
forked from mirror/pixelfed

Update AccountTransformer, I need some coffee

This commit is contained in:
Daniel Supernault 2019-09-20 23:20:22 -06:00
parent 403163f12f
commit 1ff7ba909e
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -17,7 +17,7 @@ class AccountTransformer extends Fractal\TransformerAbstract
$local = $profile->domain == null;
$is_admin = !$local ? false : $profile->user->is_admin;
$acct = $local ? $profile->username : substr($profile->username, 1);
$username = $local ? $profile->username : explode('@', $profile->username)[0];
$username = $local ? $profile->username : explode('@', $acct)[0];
return [
'id' => (string) $profile->id,
'username' => $username,