Merge pull request #5082 from pixelfed/staging

Staging
This commit is contained in:
daniel 2024-05-10 23:56:12 -06:00 committed by GitHub
commit a597e00c63
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 6 deletions

View file

@ -4,8 +4,9 @@
### Updates ### Updates
- Update DirectMessageController, add 72 hour delay for new accounts before they can send a DM ([61d105fd](https://github.com/pixelfed/pixelfed/commit/61d105fd)) - Update DirectMessageController, add 72 hour delay for new accounts before they can send a DM ([61d105fd](https://github.com/pixelfed/pixelfed/commit/61d105fd))
- Update AdminCuratedRegisterController, increase message length from 1000 to 3000 ([9a5e3471](https://github.com/pixelfed/pixelfed/commit/)) - Update AdminCuratedRegisterController, increase message length from 1000 to 3000 ([9a5e3471](https://github.com/pixelfed/pixelfed/commit/9a5e3471))
- ([](https://github.com/pixelfed/pixelfed/commit/9a5e3471)) - Update ApiV1Controller, add pe (pixelfed entity) support to /api/v1/statuses/{id}/context endpoint ([d645d6ca](https://github.com/pixelfed/pixelfed/commit/d645d6ca))
- ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.12.1 (2024-05-07)](https://github.com/pixelfed/pixelfed/compare/v0.12.0...v0.12.1) ## [v0.12.1 (2024-05-07)](https://github.com/pixelfed/pixelfed/compare/v0.12.0...v0.12.1)

View file

@ -3020,9 +3020,9 @@ class ApiV1Controller extends Controller
abort_unless($request->user()->tokenCan('read'), 403); abort_unless($request->user()->tokenCan('read'), 403);
$user = $request->user(); $user = $request->user();
AccountService::setLastActive($user->id);
$pid = $user->profile_id; $pid = $user->profile_id;
$status = StatusService::getMastodon($id, false); $status = StatusService::getMastodon($id, false);
$pe = $request->has(self::PF_API_ENTITY_KEY);
if (! $status || ! isset($status['account'])) { if (! $status || ! isset($status['account'])) {
return response('', 404); return response('', 404);
@ -3049,7 +3049,9 @@ class ApiV1Controller extends Controller
$descendants = []; $descendants = [];
if ($status['in_reply_to_id']) { if ($status['in_reply_to_id']) {
$ancestors[] = StatusService::getMastodon($status['in_reply_to_id'], false); $ancestors[] = $pe ?
StatusService::get($status['in_reply_to_id'], false) :
StatusService::getMastodon($status['in_reply_to_id'], false);
} }
if ($status['replies_count']) { if ($status['replies_count']) {
@ -3059,8 +3061,10 @@ class ApiV1Controller extends Controller
->where('in_reply_to_id', $id) ->where('in_reply_to_id', $id)
->limit(20) ->limit(20)
->pluck('id') ->pluck('id')
->map(function ($sid) { ->map(function ($sid) use ($pe) {
return StatusService::getMastodon($sid, false); return $pe ?
StatusService::get($sid, false) :
StatusService::getMastodon($sid, false);
}) })
->filter(function ($post) use ($filters) { ->filter(function ($post) use ($filters) {
return $post && isset($post['account'], $post['account']['id']) && ! in_array($post['account']['id'], $filters); return $post && isset($post['account'], $post['account']['id']) && ! in_array($post['account']['id'], $filters);