|
@@ -32,6 +32,7 @@ use App\Services\NotificationAppGatewayService;
|
|
use App\Services\PollService;
|
|
use App\Services\PollService;
|
|
use App\Services\PushNotificationService;
|
|
use App\Services\PushNotificationService;
|
|
use App\Services\ReblogService;
|
|
use App\Services\ReblogService;
|
|
|
|
+use App\Services\RelationshipService;
|
|
use App\Services\UserFilterService;
|
|
use App\Services\UserFilterService;
|
|
use App\Status;
|
|
use App\Status;
|
|
use App\Story;
|
|
use App\Story;
|
|
@@ -42,6 +43,7 @@ use App\Util\ActivityPub\Validator\Announce as AnnounceValidator;
|
|
use App\Util\ActivityPub\Validator\Follow as FollowValidator;
|
|
use App\Util\ActivityPub\Validator\Follow as FollowValidator;
|
|
use App\Util\ActivityPub\Validator\Like as LikeValidator;
|
|
use App\Util\ActivityPub\Validator\Like as LikeValidator;
|
|
use App\Util\ActivityPub\Validator\MoveValidator;
|
|
use App\Util\ActivityPub\Validator\MoveValidator;
|
|
|
|
+use App\Util\ActivityPub\Validator\RejectValidator;
|
|
use App\Util\ActivityPub\Validator\UpdatePersonValidator;
|
|
use App\Util\ActivityPub\Validator\UpdatePersonValidator;
|
|
use Cache;
|
|
use Cache;
|
|
use Illuminate\Support\Facades\Bus;
|
|
use Illuminate\Support\Facades\Bus;
|
|
@@ -120,6 +122,9 @@ class Inbox
|
|
break;
|
|
break;
|
|
|
|
|
|
case 'Reject':
|
|
case 'Reject':
|
|
|
|
+ if (RejectValidator::validate($this->payload) == false) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
$this->handleRejectActivity();
|
|
$this->handleRejectActivity();
|
|
break;
|
|
break;
|
|
|
|
|
|
@@ -245,7 +250,7 @@ class Inbox
|
|
$cc = isset($activity['cc']) ? $activity['cc'] : [];
|
|
$cc = isset($activity['cc']) ? $activity['cc'] : [];
|
|
|
|
|
|
if ($activity['type'] == 'Question') {
|
|
if ($activity['type'] == 'Question') {
|
|
- //$this->handlePollCreate();
|
|
|
|
|
|
+ // $this->handlePollCreate();
|
|
|
|
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -614,6 +619,9 @@ class Inbox
|
|
Cache::forget('profile:following_count:'.$target->id);
|
|
Cache::forget('profile:following_count:'.$target->id);
|
|
Cache::forget('profile:following_count:'.$actor->id);
|
|
Cache::forget('profile:following_count:'.$actor->id);
|
|
}
|
|
}
|
|
|
|
+ RelationshipService::refresh($actor->id, $target->id);
|
|
|
|
+ AccountService::del($actor->id);
|
|
|
|
+ AccountService::del($target->id);
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -706,10 +714,20 @@ class Inbox
|
|
'profile_id' => $actor->id,
|
|
'profile_id' => $actor->id,
|
|
'following_id' => $target->id,
|
|
'following_id' => $target->id,
|
|
]);
|
|
]);
|
|
- FollowPipeline::dispatch($follower);
|
|
|
|
-
|
|
|
|
|
|
+ FollowPipeline::dispatch($follower)->onQueue('high');
|
|
|
|
+ RelationshipService::refresh($actor->id, $target->id);
|
|
|
|
+ Cache::forget('profile:following:'.$target->id);
|
|
|
|
+ Cache::forget('profile:followers:'.$target->id);
|
|
|
|
+ Cache::forget('profile:following:'.$actor->id);
|
|
|
|
+ Cache::forget('profile:followers:'.$actor->id);
|
|
|
|
+ Cache::forget('profile:follower_count:'.$target->id);
|
|
|
|
+ Cache::forget('profile:follower_count:'.$actor->id);
|
|
|
|
+ Cache::forget('profile:following_count:'.$target->id);
|
|
|
|
+ Cache::forget('profile:following_count:'.$actor->id);
|
|
|
|
+ AccountService::del($actor->id);
|
|
|
|
+ AccountService::del($target->id);
|
|
|
|
+ RelationshipService::get($actor->id, $target->id);
|
|
$request->delete();
|
|
$request->delete();
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
public function handleDeleteActivity()
|
|
public function handleDeleteActivity()
|
|
@@ -843,7 +861,21 @@ class Inbox
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- public function handleRejectActivity() {}
|
|
|
|
|
|
+ public function handleRejectActivity()
|
|
|
|
+ {
|
|
|
|
+ $actorUrl = $this->payload['actor'];
|
|
|
|
+ $obj = $this->payload['object'];
|
|
|
|
+ $profileUrl = $obj['actor'];
|
|
|
|
+ if (! Helpers::validateUrl($actorUrl) || ! Helpers::validateLocalUrl($profileUrl)) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ $actor = Helpers::profileFetch($actorUrl);
|
|
|
|
+ $profile = Helpers::profileFetch($profileUrl);
|
|
|
|
+
|
|
|
|
+ FollowRequest::whereFollowerId($profile->id)->whereFollowingId($actor->id)->forceDelete();
|
|
|
|
+ RelationshipService::refresh($actor->id, $profile->id);
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
public function handleUndoActivity()
|
|
public function handleUndoActivity()
|
|
{
|
|
{
|
|
@@ -909,6 +941,9 @@ class Inbox
|
|
Follower::whereProfileId($profile->id)
|
|
Follower::whereProfileId($profile->id)
|
|
->whereFollowingId($following->id)
|
|
->whereFollowingId($following->id)
|
|
->delete();
|
|
->delete();
|
|
|
|
+ FollowRequest::whereFollowingId($following->id)
|
|
|
|
+ ->whereFollowerId($profile->id)
|
|
|
|
+ ->forceDelete();
|
|
Notification::whereProfileId($following->id)
|
|
Notification::whereProfileId($following->id)
|
|
->whereActorId($profile->id)
|
|
->whereActorId($profile->id)
|
|
->whereAction('follow')
|
|
->whereAction('follow')
|
|
@@ -916,6 +951,9 @@ class Inbox
|
|
->whereItemType('App\Profile')
|
|
->whereItemType('App\Profile')
|
|
->forceDelete();
|
|
->forceDelete();
|
|
FollowerService::remove($profile->id, $following->id);
|
|
FollowerService::remove($profile->id, $following->id);
|
|
|
|
+ RelationshipService::refresh($following->id, $profile->id);
|
|
|
|
+ AccountService::del($profile->id);
|
|
|
|
+ AccountService::del($following->id);
|
|
break;
|
|
break;
|
|
|
|
|
|
case 'Like':
|
|
case 'Like':
|