diff --git a/app/Http/Controllers/Settings/HomeSettings.php b/app/Http/Controllers/Settings/HomeSettings.php index e8d3d195..a9592d7c 100644 --- a/app/Http/Controllers/Settings/HomeSettings.php +++ b/app/Http/Controllers/Settings/HomeSettings.php @@ -17,6 +17,7 @@ use Mail; use Purify; use App\Mail\PasswordChange; use Illuminate\Http\Request; +use App\Services\AccountService; use App\Services\PronounService; trait HomeSettings @@ -99,10 +100,10 @@ trait HomeSettings } if ($changes === true) { - Cache::forget('user:account:id:'.$user->id); $user->save(); $profile->save(); - + Cache::forget('user:account:id:'.$user->id); + AccountService::del($profile->id); return redirect('/settings/home')->with('status', 'Profile successfully updated!'); } diff --git a/app/Jobs/SharePipeline/SharePipeline.php b/app/Jobs/SharePipeline/SharePipeline.php index 1534a9f0..cd54b90e 100644 --- a/app/Jobs/SharePipeline/SharePipeline.php +++ b/app/Jobs/SharePipeline/SharePipeline.php @@ -127,13 +127,15 @@ class SharePipeline implements ShouldQueue 'timeout' => config('federation.activitypub.delivery.timeout') ]); - $requests = function($audience) use ($client, $activity, $profile, $payload) { + $version = config('pixelfed.version'); + $appUrl = config('app.url'); + $userAgent = "(Pixelfed/{$version}; +{$appUrl})"; + + $requests = function($audience) use ($client, $activity, $profile, $payload, $userAgent) { foreach($audience as $url) { - $version = config('pixelfed.version'); - $appUrl = config('app.url'); $headers = HttpSignature::sign($profile, $url, $activity, [ 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', - 'User-Agent' => "(Pixelfed/{$version}; +{$appUrl})", + 'User-Agent' => $userAgent, ]); yield function() use ($client, $url, $headers, $payload) { return $client->postAsync($url, [ diff --git a/app/Jobs/SharePipeline/UndoSharePipeline.php b/app/Jobs/SharePipeline/UndoSharePipeline.php index 589a34fe..596d4d2d 100644 --- a/app/Jobs/SharePipeline/UndoSharePipeline.php +++ b/app/Jobs/SharePipeline/UndoSharePipeline.php @@ -90,13 +90,15 @@ class UndoSharePipeline implements ShouldQueue 'timeout' => config('federation.activitypub.delivery.timeout') ]); - $requests = function($audience) use ($client, $activity, $profile, $payload) { + $version = config('pixelfed.version'); + $appUrl = config('app.url'); + $userAgent = "(Pixelfed/{$version}; +{$appUrl})"; + + $requests = function($audience) use ($client, $activity, $profile, $payload, $userAgent) { foreach($audience as $url) { - $version = config('pixelfed.version'); - $appUrl = config('app.url'); $headers = HttpSignature::sign($profile, $url, $activity, [ 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', - 'User-Agent' => "(Pixelfed/{$version}; +{$appUrl})", + 'User-Agent' => $userAgent, ]); yield function() use ($client, $url, $headers, $payload) { return $client->postAsync($url, [ diff --git a/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php b/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php index 21295beb..ca77ff7f 100644 --- a/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php +++ b/app/Jobs/StatusPipeline/StatusActivityPubDeliver.php @@ -85,13 +85,15 @@ class StatusActivityPubDeliver implements ShouldQueue 'timeout' => config('federation.activitypub.delivery.timeout') ]); - $requests = function($audience) use ($client, $activity, $profile, $payload) { + $version = config('pixelfed.version'); + $appUrl = config('app.url'); + $userAgent = "(Pixelfed/{$version}; +{$appUrl})"; + + $requests = function($audience) use ($client, $activity, $profile, $payload, $userAgent) { foreach($audience as $url) { - $version = config('pixelfed.version'); - $appUrl = config('app.url'); $headers = HttpSignature::sign($profile, $url, $activity, [ 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', - 'User-Agent' => "(Pixelfed/{$version}; +{$appUrl})", + 'User-Agent' => $userAgent, ]); yield function() use ($client, $url, $headers, $payload) { return $client->postAsync($url, [ diff --git a/app/Jobs/StatusPipeline/StatusDelete.php b/app/Jobs/StatusPipeline/StatusDelete.php index 6a003bcc..d7f237e2 100644 --- a/app/Jobs/StatusPipeline/StatusDelete.php +++ b/app/Jobs/StatusPipeline/StatusDelete.php @@ -164,13 +164,15 @@ class StatusDelete implements ShouldQueue 'timeout' => config('federation.activitypub.delivery.timeout') ]); - $requests = function($audience) use ($client, $activity, $profile, $payload) { + $version = config('pixelfed.version'); + $appUrl = config('app.url'); + $userAgent = "(Pixelfed/{$version}; +{$appUrl})"; + + $requests = function($audience) use ($client, $activity, $profile, $payload, $userAgent) { foreach($audience as $url) { - $version = config('pixelfed.version'); - $appUrl = config('app.url'); $headers = HttpSignature::sign($profile, $url, $activity, [ 'Content-Type' => 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"', - 'User-Agent' => "(Pixelfed/{$version}; +{$appUrl})", + 'User-Agent' => $userAgent, ]); yield function() use ($client, $url, $headers, $payload) { return $client->postAsync($url, [ diff --git a/app/Services/AccountService.php b/app/Services/AccountService.php index eb744ff9..ea64855c 100644 --- a/app/Services/AccountService.php +++ b/app/Services/AccountService.php @@ -71,6 +71,7 @@ class AccountService public static function del($id) { + Cache::forget('pf:activitypub:user-object:by-id:' . $id); return Cache::forget(self::CACHE_KEY . $id); }