mirror of
https://github.com/pixelfed/pixelfed.git
synced 2025-01-31 00:40:47 +00:00
Update APHelpers
This commit is contained in:
parent
c86f36d53d
commit
5d2f93bd6d
1 changed files with 18 additions and 15 deletions
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace App\Util\ActivityPub;
|
namespace App\Util\ActivityPub;
|
||||||
|
|
||||||
use Cache, Purify, Storage, Request, Validator;
|
use DB, Cache, Purify, Storage, Request, Validator;
|
||||||
use App\{
|
use App\{
|
||||||
Activity,
|
Activity,
|
||||||
Follower,
|
Follower,
|
||||||
|
@ -295,6 +295,7 @@ class Helpers {
|
||||||
$reply_to = null;
|
$reply_to = null;
|
||||||
}
|
}
|
||||||
$ts = is_array($res['published']) ? $res['published'][0] : $res['published'];
|
$ts = is_array($res['published']) ? $res['published'][0] : $res['published'];
|
||||||
|
$status = DB::transaction(function() use($profile, $res, $url, $ts, $reply_to, $cw, $scope) {
|
||||||
$status = new Status;
|
$status = new Status;
|
||||||
$status->profile_id = $profile->id;
|
$status->profile_id = $profile->id;
|
||||||
$status->url = isset($res['url']) ? $res['url'] : $url;
|
$status->url = isset($res['url']) ? $res['url'] : $url;
|
||||||
|
@ -308,8 +309,10 @@ class Helpers {
|
||||||
$status->scope = $scope;
|
$status->scope = $scope;
|
||||||
$status->visibility = $scope;
|
$status->visibility = $scope;
|
||||||
$status->save();
|
$status->save();
|
||||||
|
|
||||||
self::importNoteAttachment($res, $status);
|
self::importNoteAttachment($res, $status);
|
||||||
|
return $status;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
return $status;
|
return $status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue