mirror of
https://github.com/YunoHost-Apps/pixelfed_ynh.git
synced 2024-09-03 20:06:04 +02:00
Update activitypub deliver
This commit is contained in:
parent
691cc991c6
commit
feeb60eb94
2 changed files with 133 additions and 135 deletions
|
@ -63,8 +63,6 @@ class StatusActivityPubDeliver implements ShouldQueue
|
|||
|
||||
$profile = $status->profile;
|
||||
|
||||
Cache::forget('status:transformer:media:attachments:'.$status->id);
|
||||
|
||||
$fractal = new Fractal\Manager();
|
||||
$fractal->setSerializer(new ArraySerializer());
|
||||
$resource = new Fractal\Resource\Item($status, new CreateNote());
|
||||
|
@ -94,10 +92,8 @@ class StatusActivityPubDeliver implements ShouldQueue
|
|||
$pool = new Pool($client, $requests($audience), [
|
||||
'concurrency' => config('pixelfed.ap_delivery_concurrency'),
|
||||
'fulfilled' => function ($response, $index) {
|
||||
Log::info('AP:deliver:success - ' . json_encode($response));
|
||||
},
|
||||
'rejected' => function ($reason, $index) {
|
||||
Log::info('AP:deliver:rejected - ' . json_encode($reason));
|
||||
}
|
||||
]);
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ class Helpers {
|
|||
|
||||
public static function validateObject($data)
|
||||
{
|
||||
// todo: undo
|
||||
$verbs = ['Create', 'Announce', 'Like', 'Follow', 'Delete', 'Accept', 'Reject', 'Undo'];
|
||||
|
||||
$valid = Validator::make($data, [
|
||||
|
@ -302,6 +301,9 @@ class Helpers {
|
|||
return Profile::whereUsername($id)->firstOrFail();
|
||||
}
|
||||
$res = self::fetchProfileFromUrl($url);
|
||||
if(isset($res['id']) == false) {
|
||||
return;
|
||||
}
|
||||
$domain = parse_url($res['id'], PHP_URL_HOST);
|
||||
$username = $res['preferredUsername'];
|
||||
$remoteUsername = "@{$username}@{$domain}";
|
||||
|
|
Loading…
Add table
Reference in a new issue