mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Update AP Inbox
This commit is contained in:
parent
3e88b7c890
commit
a55238d2e5
1 changed files with 278 additions and 283 deletions
|
@ -2,65 +2,58 @@
|
||||||
|
|
||||||
namespace App\Util\ActivityPub;
|
namespace App\Util\ActivityPub;
|
||||||
|
|
||||||
use Cache, DB, Log, Purify, Redis, Storage, Validator;
|
use App\DirectMessage;
|
||||||
use Illuminate\Support\Facades\Bus;
|
use App\Follower;
|
||||||
use App\{
|
use App\FollowRequest;
|
||||||
Activity,
|
use App\Instance;
|
||||||
DirectMessage,
|
|
||||||
Follower,
|
|
||||||
FollowRequest,
|
|
||||||
Instance,
|
|
||||||
Like,
|
|
||||||
Notification,
|
|
||||||
Media,
|
|
||||||
Profile,
|
|
||||||
Status,
|
|
||||||
StatusHashtag,
|
|
||||||
Story,
|
|
||||||
StoryView,
|
|
||||||
UserFilter
|
|
||||||
};
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use App\Util\ActivityPub\Helpers;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
use App\Jobs\LikePipeline\LikePipeline;
|
|
||||||
use App\Jobs\FollowPipeline\FollowPipeline;
|
|
||||||
use App\Jobs\DeletePipeline\DeleteRemoteProfilePipeline;
|
use App\Jobs\DeletePipeline\DeleteRemoteProfilePipeline;
|
||||||
|
use App\Jobs\FollowPipeline\FollowPipeline;
|
||||||
|
use App\Jobs\HomeFeedPipeline\FeedRemoveRemotePipeline;
|
||||||
|
use App\Jobs\LikePipeline\LikePipeline;
|
||||||
|
use App\Jobs\MovePipeline\CleanupLegacyAccountMovePipeline;
|
||||||
|
use App\Jobs\MovePipeline\MoveMigrateFollowersPipeline;
|
||||||
|
use App\Jobs\MovePipeline\ProcessMovePipeline;
|
||||||
|
use App\Jobs\MovePipeline\UnfollowLegacyAccountMovePipeline;
|
||||||
|
use App\Jobs\ProfilePipeline\HandleUpdateActivity;
|
||||||
use App\Jobs\StatusPipeline\RemoteStatusDelete;
|
use App\Jobs\StatusPipeline\RemoteStatusDelete;
|
||||||
|
use App\Jobs\StatusPipeline\StatusRemoteUpdatePipeline;
|
||||||
use App\Jobs\StoryPipeline\StoryExpire;
|
use App\Jobs\StoryPipeline\StoryExpire;
|
||||||
use App\Jobs\StoryPipeline\StoryFetch;
|
use App\Jobs\StoryPipeline\StoryFetch;
|
||||||
use App\Jobs\StatusPipeline\StatusRemoteUpdatePipeline;
|
use App\Like;
|
||||||
use App\Jobs\ProfilePipeline\HandleUpdateActivity;
|
use App\Media;
|
||||||
use App\Jobs\MovePipeline\ProcessMovePipeline;
|
use App\Models\Conversation;
|
||||||
use App\Jobs\MovePipeline\MoveMigrateFollowersPipeline;
|
use App\Models\RemoteReport;
|
||||||
use App\Jobs\MovePipeline\UnfollowLegacyAccountMovePipeline;
|
use App\Notification;
|
||||||
use App\Jobs\MovePipeline\CleanupLegacyAccountMovePipeline;
|
use App\Profile;
|
||||||
|
use App\Services\AccountService;
|
||||||
|
use App\Services\FollowerService;
|
||||||
|
use App\Services\PollService;
|
||||||
|
use App\Services\ReblogService;
|
||||||
|
use App\Services\UserFilterService;
|
||||||
|
use App\Status;
|
||||||
|
use App\Story;
|
||||||
|
use App\StoryView;
|
||||||
|
use App\UserFilter;
|
||||||
use App\Util\ActivityPub\Validator\Accept as AcceptValidator;
|
use App\Util\ActivityPub\Validator\Accept as AcceptValidator;
|
||||||
use App\Util\ActivityPub\Validator\Add as AddValidator;
|
|
||||||
use App\Util\ActivityPub\Validator\Announce as AnnounceValidator;
|
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\UndoFollow as UndoFollowValidator;
|
|
||||||
use App\Util\ActivityPub\Validator\UpdatePersonValidator;
|
|
||||||
use App\Util\ActivityPub\Validator\MoveValidator;
|
use App\Util\ActivityPub\Validator\MoveValidator;
|
||||||
|
use App\Util\ActivityPub\Validator\UpdatePersonValidator;
|
||||||
use App\Services\AccountService;
|
use Cache;
|
||||||
use App\Services\PollService;
|
use Illuminate\Support\Facades\Bus;
|
||||||
use App\Services\FollowerService;
|
use Illuminate\Support\Str;
|
||||||
use App\Services\ReblogService;
|
use Purify;
|
||||||
use App\Services\StatusService;
|
use Storage;
|
||||||
use App\Services\UserFilterService;
|
|
||||||
use App\Services\NetworkTimelineService;
|
|
||||||
use App\Models\Conversation;
|
|
||||||
use App\Models\RemoteReport;
|
|
||||||
use App\Jobs\HomeFeedPipeline\FeedRemoveRemotePipeline;
|
|
||||||
|
|
||||||
class Inbox
|
class Inbox
|
||||||
{
|
{
|
||||||
protected $headers;
|
protected $headers;
|
||||||
|
|
||||||
protected $profile;
|
protected $profile;
|
||||||
|
|
||||||
protected $payload;
|
protected $payload;
|
||||||
|
|
||||||
protected $logger;
|
protected $logger;
|
||||||
|
|
||||||
public function __construct($headers, $profile, $payload)
|
public function __construct($headers, $profile, $payload)
|
||||||
|
@ -73,7 +66,7 @@ class Inbox
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->handleVerb();
|
$this->handleVerb();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleVerb()
|
public function handleVerb()
|
||||||
|
@ -90,17 +83,23 @@ class Inbox
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Follow':
|
case 'Follow':
|
||||||
if(FollowValidator::validate($this->payload) == false) { return; }
|
if (FollowValidator::validate($this->payload) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->handleFollowActivity();
|
$this->handleFollowActivity();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Announce':
|
case 'Announce':
|
||||||
if(AnnounceValidator::validate($this->payload) == false) { return; }
|
if (AnnounceValidator::validate($this->payload) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->handleAnnounceActivity();
|
$this->handleAnnounceActivity();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Accept':
|
case 'Accept':
|
||||||
if(AcceptValidator::validate($this->payload) == false) { return; }
|
if (AcceptValidator::validate($this->payload) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->handleAcceptActivity();
|
$this->handleAcceptActivity();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -109,7 +108,9 @@ class Inbox
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Like':
|
case 'Like':
|
||||||
if(LikeValidator::validate($this->payload) == false) { return; }
|
if (LikeValidator::validate($this->payload) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->handleLikeActivity();
|
$this->handleLikeActivity();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -144,6 +145,7 @@ class Inbox
|
||||||
case 'Move':
|
case 'Move':
|
||||||
if (MoveValidator::validate($this->payload) == false) {
|
if (MoveValidator::validate($this->payload) == false) {
|
||||||
\Log::info('[AP][INBOX][MOVE] VALIDATE_FAILURE '.json_encode($this->payload));
|
\Log::info('[AP][INBOX][MOVE] VALIDATE_FAILURE '.json_encode($this->payload));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$this->handleMoveActivity();
|
$this->handleMoveActivity();
|
||||||
|
@ -205,7 +207,6 @@ class Inbox
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleCreateActivity()
|
public function handleCreateActivity()
|
||||||
|
@ -240,6 +241,7 @@ class Inbox
|
||||||
|
|
||||||
if ($activity['type'] == 'Question') {
|
if ($activity['type'] == 'Question') {
|
||||||
$this->handlePollCreate();
|
$this->handlePollCreate();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,6 +252,7 @@ class Inbox
|
||||||
parse_url($to[0], PHP_URL_HOST) == config('pixelfed.domain.app')
|
parse_url($to[0], PHP_URL_HOST) == config('pixelfed.domain.app')
|
||||||
) {
|
) {
|
||||||
$this->handleDirectMessage();
|
$this->handleDirectMessage();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +265,7 @@ class Inbox
|
||||||
}
|
}
|
||||||
$this->handleNoteCreate();
|
$this->handleNoteCreate();
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleNoteReply()
|
public function handleNoteReply()
|
||||||
|
@ -277,7 +280,7 @@ class Inbox
|
||||||
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
||||||
|
|
||||||
Helpers::statusFirstOrFetch($url, true);
|
Helpers::statusFirstOrFetch($url, true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handlePollCreate()
|
public function handlePollCreate()
|
||||||
|
@ -289,7 +292,7 @@ class Inbox
|
||||||
}
|
}
|
||||||
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
$url = isset($activity['url']) ? $activity['url'] : $activity['id'];
|
||||||
Helpers::statusFirstOrFetch($url);
|
Helpers::statusFirstOrFetch($url);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleNoteCreate()
|
public function handleNoteCreate()
|
||||||
|
@ -307,6 +310,7 @@ class Inbox
|
||||||
Helpers::validateLocalUrl($activity['inReplyTo'])
|
Helpers::validateLocalUrl($activity['inReplyTo'])
|
||||||
) {
|
) {
|
||||||
$this->handlePollVote();
|
$this->handlePollVote();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -335,7 +339,7 @@ class Inbox
|
||||||
$actor,
|
$actor,
|
||||||
$activity
|
$activity
|
||||||
);
|
);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handlePollVote()
|
public function handlePollVote()
|
||||||
|
@ -390,7 +394,6 @@ class Inbox
|
||||||
|
|
||||||
PollService::del($status->id);
|
PollService::del($status->id);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleDirectMessage()
|
public function handleDirectMessage()
|
||||||
|
@ -450,13 +453,13 @@ class Inbox
|
||||||
Conversation::updateOrInsert(
|
Conversation::updateOrInsert(
|
||||||
[
|
[
|
||||||
'to_id' => $profile->id,
|
'to_id' => $profile->id,
|
||||||
'from_id' => $actor->id
|
'from_id' => $actor->id,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'status_id' => $status->id,
|
'status_id' => $status->id,
|
||||||
'dm_id' => $dm->id,
|
'dm_id' => $dm->id,
|
||||||
'is_hidden' => $hidden
|
'is_hidden' => $hidden,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -473,7 +476,7 @@ class Inbox
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$media = new Media();
|
$media = new Media;
|
||||||
$media->remote_media = true;
|
$media->remote_media = true;
|
||||||
$media->status_id = $status->id;
|
$media->status_id = $status->id;
|
||||||
$media->profile_id = $status->profile_id;
|
$media->profile_id = $status->profile_id;
|
||||||
|
@ -506,7 +509,7 @@ class Inbox
|
||||||
$dm->meta = [
|
$dm->meta = [
|
||||||
'domain' => parse_url($msgText, PHP_URL_HOST),
|
'domain' => parse_url($msgText, PHP_URL_HOST),
|
||||||
'local' => parse_url($msgText, PHP_URL_HOST) ==
|
'local' => parse_url($msgText, PHP_URL_HOST) ==
|
||||||
parse_url(config('app.url'), PHP_URL_HOST)
|
parse_url(config('app.url'), PHP_URL_HOST),
|
||||||
];
|
];
|
||||||
$dm->save();
|
$dm->save();
|
||||||
}
|
}
|
||||||
|
@ -519,7 +522,7 @@ class Inbox
|
||||||
->exists();
|
->exists();
|
||||||
|
|
||||||
if ($profile->domain == null && $hidden == false && ! $nf) {
|
if ($profile->domain == null && $hidden == false && ! $nf) {
|
||||||
$notification = new Notification();
|
$notification = new Notification;
|
||||||
$notification->profile_id = $profile->id;
|
$notification->profile_id = $profile->id;
|
||||||
$notification->actor_id = $actor->id;
|
$notification->actor_id = $actor->id;
|
||||||
$notification->action = 'dm';
|
$notification->action = 'dm';
|
||||||
|
@ -528,7 +531,6 @@ class Inbox
|
||||||
$notification->save();
|
$notification->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleFollowActivity()
|
public function handleFollowActivity()
|
||||||
|
@ -568,7 +570,7 @@ class Inbox
|
||||||
'follower_id' => $actor->id,
|
'follower_id' => $actor->id,
|
||||||
'following_id' => $target->id,
|
'following_id' => $target->id,
|
||||||
], [
|
], [
|
||||||
'activity' => collect($this->payload)->only(['id','actor','object','type'])->toArray()
|
'activity' => collect($this->payload)->only(['id', 'actor', 'object', 'type'])->toArray(),
|
||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
$follower = new Follower;
|
$follower = new Follower;
|
||||||
|
@ -590,8 +592,8 @@ class Inbox
|
||||||
'id' => $this->payload['id'],
|
'id' => $this->payload['id'],
|
||||||
'actor' => $actor->permalink(),
|
'actor' => $actor->permalink(),
|
||||||
'type' => 'Follow',
|
'type' => 'Follow',
|
||||||
'object' => $target->permalink()
|
'object' => $target->permalink(),
|
||||||
]
|
],
|
||||||
];
|
];
|
||||||
Helpers::sendSignedObject($target, $actor->inbox_url, $accept);
|
Helpers::sendSignedObject($target, $actor->inbox_url, $accept);
|
||||||
Cache::forget('profile:follower_count:'.$target->id);
|
Cache::forget('profile:follower_count:'.$target->id);
|
||||||
|
@ -600,7 +602,6 @@ class Inbox
|
||||||
Cache::forget('profile:following_count:'.$actor->id);
|
Cache::forget('profile:following_count:'.$actor->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleAnnounceActivity()
|
public function handleAnnounceActivity()
|
||||||
|
@ -630,7 +631,7 @@ class Inbox
|
||||||
$status = Status::firstOrCreate([
|
$status = Status::firstOrCreate([
|
||||||
'profile_id' => $actor->id,
|
'profile_id' => $actor->id,
|
||||||
'reblog_of_id' => $parent->id,
|
'reblog_of_id' => $parent->id,
|
||||||
'type' => 'share'
|
'type' => 'share',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Notification::firstOrCreate(
|
Notification::firstOrCreate(
|
||||||
|
@ -648,7 +649,6 @@ class Inbox
|
||||||
|
|
||||||
ReblogService::addPostReblog($parent->profile_id, $status->id);
|
ReblogService::addPostReblog($parent->profile_id, $status->id);
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleAcceptActivity()
|
public function handleAcceptActivity()
|
||||||
|
@ -696,7 +696,6 @@ class Inbox
|
||||||
|
|
||||||
$request->delete();
|
$request->delete();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleDeleteActivity()
|
public function handleDeleteActivity()
|
||||||
|
@ -715,6 +714,7 @@ class Inbox
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('inbox');
|
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('inbox');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (! isset(
|
if (! isset(
|
||||||
|
@ -741,6 +741,7 @@ class Inbox
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('inbox');
|
DeleteRemoteProfilePipeline::dispatch($profile)->onQueue('inbox');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -766,6 +767,7 @@ class Inbox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RemoteStatusDelete::dispatch($status)->onQueue('high');
|
RemoteStatusDelete::dispatch($status)->onQueue('high');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -775,6 +777,7 @@ class Inbox
|
||||||
if ($story) {
|
if ($story) {
|
||||||
StoryExpire::dispatch($story)->onQueue('story');
|
StoryExpire::dispatch($story)->onQueue('story');
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -783,7 +786,7 @@ class Inbox
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleLikeActivity()
|
public function handleLikeActivity()
|
||||||
|
@ -815,7 +818,7 @@ class Inbox
|
||||||
|
|
||||||
$like = Like::firstOrCreate([
|
$like = Like::firstOrCreate([
|
||||||
'profile_id' => $profile->id,
|
'profile_id' => $profile->id,
|
||||||
'status_id' => $status->id
|
'status_id' => $status->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($like->wasRecentlyCreated == true) {
|
if ($like->wasRecentlyCreated == true) {
|
||||||
|
@ -824,12 +827,9 @@ class Inbox
|
||||||
LikePipeline::dispatch($like);
|
LikePipeline::dispatch($like);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleRejectActivity()
|
public function handleRejectActivity() {}
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public function handleUndoActivity()
|
public function handleUndoActivity()
|
||||||
{
|
{
|
||||||
|
@ -931,7 +931,7 @@ class Inbox
|
||||||
->forceDelete();
|
->forceDelete();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleViewActivity()
|
public function handleViewActivity()
|
||||||
|
@ -983,7 +983,7 @@ class Inbox
|
||||||
|
|
||||||
$view = StoryView::firstOrCreate([
|
$view = StoryView::firstOrCreate([
|
||||||
'story_id' => $story->id,
|
'story_id' => $story->id,
|
||||||
'profile_id' => $profile->id
|
'profile_id' => $profile->id,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if ($view->wasRecentlyCreated == true) {
|
if ($view->wasRecentlyCreated == true) {
|
||||||
|
@ -991,7 +991,6 @@ class Inbox
|
||||||
$story->save();
|
$story->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleStoryReactionActivity()
|
public function handleStoryReactionActivity()
|
||||||
|
@ -1074,7 +1073,7 @@ class Inbox
|
||||||
$status->in_reply_to_profile_id = $story->profile_id;
|
$status->in_reply_to_profile_id = $story->profile_id;
|
||||||
$status->entities = json_encode([
|
$status->entities = json_encode([
|
||||||
'story_id' => $story->id,
|
'story_id' => $story->id,
|
||||||
'reaction' => $text
|
'reaction' => $text,
|
||||||
]);
|
]);
|
||||||
$status->save();
|
$status->save();
|
||||||
|
|
||||||
|
@ -1088,20 +1087,20 @@ class Inbox
|
||||||
'story_actor_username' => $actorProfile->username,
|
'story_actor_username' => $actorProfile->username,
|
||||||
'story_id' => $story->id,
|
'story_id' => $story->id,
|
||||||
'story_media_url' => url(Storage::url($story->path)),
|
'story_media_url' => url(Storage::url($story->path)),
|
||||||
'reaction' => $text
|
'reaction' => $text,
|
||||||
]);
|
]);
|
||||||
$dm->save();
|
$dm->save();
|
||||||
|
|
||||||
Conversation::updateOrInsert(
|
Conversation::updateOrInsert(
|
||||||
[
|
[
|
||||||
'to_id' => $story->profile_id,
|
'to_id' => $story->profile_id,
|
||||||
'from_id' => $actorProfile->id
|
'from_id' => $actorProfile->id,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'type' => 'story:react',
|
'type' => 'story:react',
|
||||||
'status_id' => $status->id,
|
'status_id' => $status->id,
|
||||||
'dm_id' => $dm->id,
|
'dm_id' => $dm->id,
|
||||||
'is_hidden' => false
|
'is_hidden' => false,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1113,7 +1112,6 @@ class Inbox
|
||||||
$n->action = 'story:react';
|
$n->action = 'story:react';
|
||||||
$n->save();
|
$n->save();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleStoryReplyActivity()
|
public function handleStoryReplyActivity()
|
||||||
|
@ -1169,7 +1167,6 @@ class Inbox
|
||||||
|
|
||||||
$actorProfile = Helpers::profileFetch($actor);
|
$actorProfile = Helpers::profileFetch($actor);
|
||||||
|
|
||||||
|
|
||||||
if (AccountService::blocksDomain($targetProfile->id, $actorProfile->domain) == true) {
|
if (AccountService::blocksDomain($targetProfile->id, $actorProfile->domain) == true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1197,7 +1194,7 @@ class Inbox
|
||||||
$status->in_reply_to_profile_id = $story->profile_id;
|
$status->in_reply_to_profile_id = $story->profile_id;
|
||||||
$status->entities = json_encode([
|
$status->entities = json_encode([
|
||||||
'story_id' => $story->id,
|
'story_id' => $story->id,
|
||||||
'caption' => $text
|
'caption' => $text,
|
||||||
]);
|
]);
|
||||||
$status->save();
|
$status->save();
|
||||||
|
|
||||||
|
@ -1211,20 +1208,20 @@ class Inbox
|
||||||
'story_actor_username' => $actorProfile->username,
|
'story_actor_username' => $actorProfile->username,
|
||||||
'story_id' => $story->id,
|
'story_id' => $story->id,
|
||||||
'story_media_url' => url(Storage::url($story->path)),
|
'story_media_url' => url(Storage::url($story->path)),
|
||||||
'caption' => $text
|
'caption' => $text,
|
||||||
]);
|
]);
|
||||||
$dm->save();
|
$dm->save();
|
||||||
|
|
||||||
Conversation::updateOrInsert(
|
Conversation::updateOrInsert(
|
||||||
[
|
[
|
||||||
'to_id' => $story->profile_id,
|
'to_id' => $story->profile_id,
|
||||||
'from_id' => $actorProfile->id
|
'from_id' => $actorProfile->id,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'type' => 'story:comment',
|
'type' => 'story:comment',
|
||||||
'status_id' => $status->id,
|
'status_id' => $status->id,
|
||||||
'dm_id' => $dm->id,
|
'dm_id' => $dm->id,
|
||||||
'is_hidden' => false
|
'is_hidden' => false,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1236,7 +1233,6 @@ class Inbox
|
||||||
$n->action = 'story:comment';
|
$n->action = 'story:comment';
|
||||||
$n->save();
|
$n->save();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleFlagActivity()
|
public function handleFlagActivity()
|
||||||
|
@ -1321,7 +1317,7 @@ class Inbox
|
||||||
$instanceHost = parse_url($id, PHP_URL_HOST);
|
$instanceHost = parse_url($id, PHP_URL_HOST);
|
||||||
|
|
||||||
$instance = Instance::updateOrCreate([
|
$instance = Instance::updateOrCreate([
|
||||||
'domain' => $instanceHost
|
'domain' => $instanceHost,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$report = new RemoteReport;
|
$report = new RemoteReport;
|
||||||
|
@ -1332,11 +1328,10 @@ class Inbox
|
||||||
$report->instance_id = $instance->id;
|
$report->instance_id = $instance->id;
|
||||||
$report->report_meta = [
|
$report->report_meta = [
|
||||||
'actor' => $actor,
|
'actor' => $actor,
|
||||||
'object' => $object
|
'object' => $object,
|
||||||
];
|
];
|
||||||
$report->save();
|
$report->save();
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleUpdateActivity()
|
public function handleUpdateActivity()
|
||||||
|
@ -1376,10 +1371,10 @@ class Inbox
|
||||||
}
|
}
|
||||||
|
|
||||||
Bus::chain([
|
Bus::chain([
|
||||||
new ProcessMoveActivity,
|
new ProcessMovePipeline,
|
||||||
new MoveMigrateFollowersPipeline,
|
new MoveMigrateFollowersPipeline,
|
||||||
new UnfollowLegacyAccountMovePipeline,
|
new UnfollowLegacyAccountMovePipeline,
|
||||||
new CleanupLegacyAccountMovePipeline
|
new CleanupLegacyAccountMovePipeline,
|
||||||
])
|
])
|
||||||
->onQueue('move')
|
->onQueue('move')
|
||||||
->dispatch($target, $activity);
|
->dispatch($target, $activity);
|
||||||
|
|
Loading…
Reference in a new issue