mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-22 21:13:16 +00:00
Merge pull request #371 from pixelfed/frontend-ui-refactor
Add avatar to AP profile
This commit is contained in:
commit
b9e7848849
2 changed files with 8 additions and 13 deletions
|
@ -20,14 +20,10 @@ class ProfileController extends Controller
|
||||||
$user = Profile::whereUsername($username)->firstOrFail();
|
$user = Profile::whereUsername($username)->firstOrFail();
|
||||||
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
||||||
|
|
||||||
$mimes = [
|
if($request->wantsJson() && config('pixelfed.activitypub_enabled')) {
|
||||||
'application/activity+json',
|
|
||||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
|
||||||
];
|
|
||||||
|
|
||||||
if(str_contains($request->header('accept'), $mimes) && config('pixelfed.activitypub_enabled')) {
|
|
||||||
return $this->showActivityPub($request, $user);
|
return $this->showActivityPub($request, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($user->is_private == true) {
|
if($user->is_private == true) {
|
||||||
$can_access = $this->privateProfileCheck($user);
|
$can_access = $this->privateProfileCheck($user);
|
||||||
if($can_access !== true) {
|
if($can_access !== true) {
|
||||||
|
@ -53,12 +49,7 @@ class ProfileController extends Controller
|
||||||
$user = Profile::whereUsername($username)->firstOrFail();
|
$user = Profile::whereUsername($username)->firstOrFail();
|
||||||
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
$settings = User::whereUsername($username)->firstOrFail()->settings;
|
||||||
|
|
||||||
$mimes = [
|
if($request->wantsJson() && config('pixelfed.activitypub_enabled')) {
|
||||||
'application/activity+json',
|
|
||||||
'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'
|
|
||||||
];
|
|
||||||
|
|
||||||
if(str_contains($request->header('accept'), $mimes) && config('pixelfed.activitypub_enabled')) {
|
|
||||||
return $this->showActivityPub($request, $user);
|
return $this->showActivityPub($request, $user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,11 @@ class ProfileTransformer extends Fractal\TransformerAbstract
|
||||||
'endpoints' => [
|
'endpoints' => [
|
||||||
'sharedInbox' => config('routes.api.sharedInbox')
|
'sharedInbox' => config('routes.api.sharedInbox')
|
||||||
],
|
],
|
||||||
|
'icon' => [
|
||||||
|
'type' => 'Image',
|
||||||
|
'mediaType' => 'image/jpeg',
|
||||||
|
'url' => $profile->avatarUrl()
|
||||||
|
]
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue