Update AccountTransformer.php

pull/6500/head
Shlee 5 months ago committed by GitHub
parent a73bbb12e2
commit 8f782917d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -11,11 +11,12 @@ class AccountTransformer extends Fractal\TransformerAbstract
{ {
$local = $profile->domain == null; $local = $profile->domain == null;
$username = $local ? $profile->username : explode('@', substr($profile->username, 1))[0]; $username = $local ? $profile->username : explode('@', substr($profile->username, 1))[0];
$acct = $local ? $profile->username : substr($profile->username, 1);
return [ return [
'id' => (string) $profile->id, 'id' => (string) $profile->id,
'username' => $username, 'username' => $username,
'acct' => $username, 'acct' => $acct,
'display_name' => $profile->name, 'display_name' => $profile->name,
'locked' => (bool) $profile->is_private, 'locked' => (bool) $profile->is_private,
'bot' => false, 'bot' => false,

Loading…
Cancel
Save