<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
use Friendica\App;
use Friendica\Content;
use Friendica\Core\L10n;
+use Friendica\Core\Protocol;
use Friendica\Core\Session\Capability\IHandleUserSessions;
use Friendica\Core\System;
use Friendica\Model\Item;
System::httpError(403);
}
- $item = Post::selectFirst(['private', 'body', 'uri'], ['id' => $post_id]);
+ $item = Post::selectFirst(['private', 'body', 'uri', 'plink', 'network'], ['id' => $post_id]);
if (!$item || $item['private'] == Item::PRIVATE) {
System::httpError(404);
}
$shared = $this->contentItem->getSharedPost($item, ['uri']);
if ($shared && empty($shared['comment'])) {
$content = '[share]' . $shared['post']['uri'] . '[/share]';
+ } elseif ($item['network'] == Protocol::FEED) {
+ $content = '[attachment]' . $item['plink'] . '[/attachment]';
} else {
$content = '[share]' . $item['uri'] . '[/share]';
}