From 3679332114326ed688ba5b0d8f2e882fca9b25e4 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jun 2019 20:35:32 -0600 Subject: [PATCH 1/2] Update InboxValidator job --- app/Jobs/InboxPipeline/InboxValidator.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Jobs/InboxPipeline/InboxValidator.php b/app/Jobs/InboxPipeline/InboxValidator.php index 718c73040..9a595c99a 100644 --- a/app/Jobs/InboxPipeline/InboxValidator.php +++ b/app/Jobs/InboxPipeline/InboxValidator.php @@ -48,12 +48,12 @@ class InboxValidator implements ShouldQueue $profile = Profile::whereNull('domain')->whereUsername($username)->first(); - if(empty($profile)) { - return; + if(empty($profile) || empty($headers) || empty($payload)) { + return true; } if($profile->status != null) { - return; + return true; } if($this->verifySignature($headers, $profile, $payload) == true) { From 1e541e34eeafa65910970ef0b293dca91964118e Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Sun, 9 Jun 2019 20:36:08 -0600 Subject: [PATCH 2/2] Update RelationshipTransformer --- app/Transformer/Api/RelationshipTransformer.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/Transformer/Api/RelationshipTransformer.php b/app/Transformer/Api/RelationshipTransformer.php index 544a9bfd4..280d72392 100644 --- a/app/Transformer/Api/RelationshipTransformer.php +++ b/app/Transformer/Api/RelationshipTransformer.php @@ -10,13 +10,14 @@ class RelationshipTransformer extends Fractal\TransformerAbstract { public function transform(Profile $profile) { - $user = Auth::user()->profile; + $auth = Auth::check(); + $user = $auth ? Auth::user()->profile : false; return [ 'id' => (string) $profile->id, - 'following' => $user->follows($profile), - 'followed_by' => $user->followedBy($profile), - 'blocking' => $user->blockedIds()->contains($profile->id), - 'muting' => $user->mutedIds()->contains($profile->id), + 'following' => $auth ? $user->follows($profile) : false, + 'followed_by' => $auth ? $user->followedBy($profile) : false, + 'blocking' => $auth ? $user->blockedIds()->contains($profile->id) : false, + 'muting' => $auth ? $user->mutedIds()->contains($profile->id) : false, 'muting_notifications' => null, 'requested' => null, 'domain_blocking' => null,