commit
86d56c7f57
|
@ -72,22 +72,18 @@ class Context extends BaseApi
|
||||||
|
|
||||||
$statuses = ['ancestors' => [], 'descendants' => []];
|
$statuses = ['ancestors' => [], 'descendants' => []];
|
||||||
|
|
||||||
$ancestors = [];
|
$ancestors = self::getParents($id, $parents);
|
||||||
foreach (self::getParents($id, $parents) as $ancestor) {
|
|
||||||
$ancestors[] = $ancestor;
|
|
||||||
}
|
|
||||||
|
|
||||||
asort($ancestors);
|
asort($ancestors);
|
||||||
|
|
||||||
foreach (array_slice($ancestors, 0, $request['limit']) as $ancestor) {
|
foreach (array_slice($ancestors, 0, $request['limit']) as $ancestor) {
|
||||||
$statuses['ancestors'][] = DI::mstdnStatus()->createFromUriId($ancestor, $uid);;
|
$statuses['ancestors'][] = DI::mstdnStatus()->createFromUriId($ancestor, $uid);;
|
||||||
}
|
}
|
||||||
|
|
||||||
$descendants = [];
|
$descendants = self::getChildren($id, $children);
|
||||||
foreach (self::getChildren($id, $children) as $descendant) {
|
|
||||||
$descendants[] = $descendant;
|
|
||||||
}
|
|
||||||
|
|
||||||
asort($descendants);
|
asort($descendants);
|
||||||
|
|
||||||
foreach (array_slice($descendants, 0, $request['limit']) as $descendant) {
|
foreach (array_slice($descendants, 0, $request['limit']) as $descendant) {
|
||||||
$statuses['descendants'][] = DI::mstdnStatus()->createFromUriId($descendant, $uid);
|
$statuses['descendants'][] = DI::mstdnStatus()->createFromUriId($descendant, $uid);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue