mirror of
https://github.com/friendica/friendica
synced 2024-11-10 03:42:53 +00:00
Issue 13940: handle posts that can't be found in contexts
This commit is contained in:
parent
424e219c53
commit
7471513269
1 changed files with 10 additions and 2 deletions
|
@ -129,7 +129,11 @@ class Context extends BaseApi
|
||||||
$display_quotes = self::appSupportsQuotes();
|
$display_quotes = self::appSupportsQuotes();
|
||||||
|
|
||||||
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, $display_quotes);
|
try {
|
||||||
|
$statuses['ancestors'][] = DI::mstdnStatus()->createFromUriId($ancestor, $uid, $display_quotes);
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$this->logger->info('Post not fetchable', ['uri-id' => $ancestor, 'uid' => $uid, 'error' => $th]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$descendants = array_diff(self::getChildren($id, $children), $deleted);
|
$descendants = array_diff(self::getChildren($id, $children), $deleted);
|
||||||
|
@ -137,7 +141,11 @@ class Context extends BaseApi
|
||||||
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, $display_quotes);
|
try {
|
||||||
|
$statuses['descendants'][] = DI::mstdnStatus()->createFromUriId($descendant, $uid, $display_quotes);
|
||||||
|
} catch (\Throwable $th) {
|
||||||
|
$this->logger->info('Post not fetchable', ['uri-id' => $descendant, 'uid' => $uid, 'error' => $th]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->jsonExit($statuses);
|
$this->jsonExit($statuses);
|
||||||
|
|
Loading…
Reference in a new issue