Merge pull request #5423 from pixelfed/staging

Update asp
This commit is contained in:
daniel 2025-01-04 00:53:54 -07:00 committed by GitHub
commit a7e561d696
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,6 +20,7 @@ use App\Observers\StatusObserver;
use App\Observers\UserFilterObserver; use App\Observers\UserFilterObserver;
use App\Observers\UserObserver; use App\Observers\UserObserver;
use App\Profile; use App\Profile;
use App\Services\AccountService;
use App\Status; use App\Status;
use App\StatusHashtag; use App\StatusHashtag;
use App\User; use App\User;
@ -32,6 +33,7 @@ use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Validator;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Laravel\Pulse\Facades\Pulse;
use URL; use URL;
class AppServiceProvider extends ServiceProvider class AppServiceProvider extends ServiceProvider
@ -69,6 +71,20 @@ class AppServiceProvider extends ServiceProvider
return $user->is_admin === 1; return $user->is_admin === 1;
}); });
Pulse::user(function ($user) {
$acct = AccountService::get($user->profile_id, true);
return $acct ? [
'name' => $acct['username'],
'extra' => $user->email,
'avatar' => $acct['avatar'],
] : [
'name' => $user->username,
'extra' => 'DELETED',
'avatar' => '/storage/avatars/default.jpg',
];
});
// Model::preventLazyLoading(true); // Model::preventLazyLoading(true);
} }