Merge pull request #2253 from pixelfed/staging

Add status ancestor and descendant context
This commit is contained in:
daniel 2020-06-18 21:10:13 -06:00 committed by GitHub
commit 9bf4917fd3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 36 deletions

View file

@ -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

18
.github/dependabot.yml vendored Normal file
View file

@ -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

View file

@ -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)

View file

@ -1525,11 +1525,29 @@ class ApiV1Controller extends Controller
}
}
// Return empty response since we don't handle threading like this
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);
}