diff --git a/.dependabot/config.yml b/.dependabot/config.yml deleted file mode 100644 index 7fd3c76df..000000000 --- a/.dependabot/config.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: 1 - -update_configs: - - package_manager: "php:composer" - directory: "/" - update_schedule: "daily" - # Supported update schedule: live daily weekly monthly - target_branch: "staging" - version_requirement_updates: "auto" - # Supported version requirements: auto widen_ranges increase_versions increase_versions_if_necessary - allowed_updates: - - match: - dependency_type: "all" - # Supported dependency types: all indirect direct production development - update_type: "all" - # Supported update types: all security - - - package_manager: "javascript" - directory: "/" - update_schedule: "daily" - # Supported update schedule: live daily weekly monthly - target_branch: "staging" - version_requirement_updates: "auto" - # Supported version requirements: auto widen_ranges increase_versions increase_versions_if_necessary - allowed_updates: - - match: - dependency_type: "all" - # Supported dependency types: all indirect direct production development - update_type: "all" - # Supported update types: all security - diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..e924cb855 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: +- package-ecosystem: composer + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 99 + target-branch: staging + allow: + - dependency-type: all +- package-ecosystem: npm + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 99 + target-branch: staging + allow: + - dependency-type: all diff --git a/CHANGELOG.md b/CHANGELOG.md index bf5637584..e07499599 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ - Updated AP Helpers, update bio + name ([4bee8397](https://github.com/pixelfed/pixelfed/commit/4bee8397)) - Updated Profile component, add bookmark loader ([c8d5edc9](https://github.com/pixelfed/pixelfed/commit/c8d5edc9)) - Updated PostComponent, add recent posts ([b289f2f6](https://github.com/pixelfed/pixelfed/commit/b289f2f6)) +- Updated ApiV1Controller, add status ancestor and descendant context ([a0bde855](https://github.com/pixelfed/pixelfed/commit/a0bde855)) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 17d6fc269..edf89261c 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1525,11 +1525,29 @@ class ApiV1Controller extends Controller } } - // Return empty response since we don't handle threading like this - $res = [ - 'ancestors' => [], - 'descendants' => [] - ]; + if($status->comments_disabled) { + $res = [ + 'ancestors' => [], + 'descendants' => [] + ]; + } else { + $ancestors = $status->parent(); + if($ancestors) { + $ares = new Fractal\Resource\Item($ancestors, new StatusTransformer()); + $ancestors = [ + $this->fractal->createData($ares)->toArray() + ]; + } else { + $ancestors = []; + } + $descendants = Status::whereInReplyToId($id)->latest()->limit(20)->get(); + $dres = new Fractal\Resource\Collection($descendants, new StatusTransformer()); + $descendants = $this->fractal->createData($dres)->toArray(); + $res = [ + 'ancestors' => $ancestors, + 'descendants' => $descendants + ]; + } return response()->json($res); }