use Friendica\Content\ContactSelector;
use Friendica\Content\Item as ContentItem;
use Friendica\Content\Text\BBCode;
+use Friendica\Core\Logger;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\Model\Item;
}
if ($is_reshare) {
- $reshare = $this->createFromUriId($uriId, $uid, $display_quote, false, false)->toArray();
+ try {
+ $reshare = $this->createFromUriId($uriId, $uid, $display_quote, false, false)->toArray();
+ } catch (\Throwable $th) {
+ Logger::info('Reshare not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ $reshare = [];
+ }
} else {
$reshare = [];
}
if ($in_reply_status && ($item['gravity'] == Item::GRAVITY_COMMENT)) {
- $in_reply = $this->createFromUriId($item['thr-parent-id'], $uid, $display_quote, false, false)->toArray();
+ try {
+ $in_reply = $this->createFromUriId($item['thr-parent-id'], $uid, $display_quote, false, false)->toArray();
+ } catch (\Throwable $th) {
+ Logger::info('Reply post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ $in_reply = [];
+ }
} else {
$in_reply = [];
}
}
if (!empty($quote_id)) {
- $quote = $this->createFromUriId($quote_id, $uid, false, false, false)->toArray();
+ try {
+ $quote = $this->createFromUriId($quote_id, $uid, false, false, false)->toArray();
+ } catch (\Throwable $th) {
+ Logger::info('Quote not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ $quote = [];
+ }
} else {
$quote = [];
}
namespace Friendica\Module\Api\Mastodon;
+use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['uri-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);
namespace Friendica\Module\Api\Mastodon;
+use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['thr-parent-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['thr-parent-id'], $uid, $display_quotes);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['thr-parent-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['thr-parent-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);
namespace Friendica\Module\Api\Mastodon;
+use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['uri-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);
namespace Friendica\Module\Api\Mastodon\Timelines;
+use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['uri-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);
namespace Friendica\Module\Api\Mastodon\Timelines;
+use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['uri-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);
namespace Friendica\Module\Api\Mastodon\Timelines;
+use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
$statuses = [];
while ($item = Post::fetch($items)) {
self::setBoundaries($item['uri-id']);
- $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ try {
+ $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($items);
namespace Friendica\Module\Api\Mastodon\Trends;
+use Friendica\Core\Logger;
use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
$trending = [];
$statuses = Post::selectPostThread(['uri-id'], $condition, ['limit' => $request['limit'], 'order' => ['total-actors' => true]]);
while ($status = Post::fetch($statuses)) {
- $trending[] = DI::mstdnStatus()->createFromUriId($status['uri-id'], $uid, $display_quotes);
+ try {
+ $trending[] = DI::mstdnStatus()->createFromUriId($status['uri-id'], $uid, $display_quotes);
+ } catch (\Throwable $th) {
+ Logger::info('Post not fetchable', ['uri-id' => $status['uri-id'], 'uid' => $uid, 'error' => $th]);
+ }
}
DBA::close($statuses);