X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FActivityPub%2FProcessor.php;h=d57842c2b226362eae4c16cccc9fa3e4eaf842c2;hb=24c32cff0dcd38d5aa509208f5f17abb05a8b140;hp=d689ba72a506099700b29364a8dfb33c76fd18be;hpb=520cb824ec7be1ddb64f8cd01db7b732c640f4bf;p=friendica.git diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index d689ba72a5..d57842c2b2 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1,6 +1,6 @@ $activity]); + Queue::remove($activity); + return; + } + + $reporter_id = Contact::getIdForURL($activity['actor']); + if (empty($reporter_id)) { + Logger::info('Unknown actor', ['activity' => $activity]); + Queue::remove($activity); + return; + } + + $uri_ids = []; + foreach ($activity['object_ids'] as $status_id) { + $post = Post::selectFirst(['uri-id'], ['uri' => $status_id]); + if (!empty($post['uri-id'])) { + $uri_ids[] = $post['uri-id']; + } + } + + $report = DI::reportFactory()->createFromReportsRequest($reporter_id, $account_id, $activity['content'], null, '', false, $uri_ids); + DI::report()->save($report); + + Logger::info('Stored report', ['reporter' => $reporter_id, 'account_id' => $account_id, 'comment' => $activity['content'], 'object_ids' => $activity['object_ids']]); + } + /** * Accept a follow request *