Issue 12345: No link preview on DFRN posts

This commit is contained in:
Michael
2022-12-08 05:49:25 +00:00
parent b9cb94c432
commit 7d51fa47d5
6 changed files with 72 additions and 26 deletions

View File

@@ -711,7 +711,7 @@ class DFRN
*/
private static function getAttachment($doc, $root, array $item)
{
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]) as $attachment) {
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT]) as $attachment) {
$attributes = ['rel' => 'enclosure',
'href' => $attachment['url'],
'type' => $attachment['mimetype']];

View File

@@ -499,7 +499,7 @@ class Diaspora
}
if (!($fields = self::validPosting($msg))) {
Logger::warning('Invalid posting');
Logger::warning('Invalid posting', ['msg' => $msg]);
return false;
}
@@ -534,7 +534,7 @@ class Diaspora
if (is_null($fields)) {
$private = true;
if (!($fields = self::validPosting($msg))) {
Logger::warning('Invalid posting');
Logger::warning('Invalid posting', ['msg' => $msg]);
return false;
}
} else {
@@ -3387,7 +3387,7 @@ class Diaspora
$body = '### ' . html_entity_decode($title) . "\n\n" . $body;
}
$attachments = Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]);
$attachments = Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT]);
if (!empty($attachments)) {
$body .= "\n[hr]\n";
foreach ($attachments as $attachment) {

View File

@@ -1186,7 +1186,7 @@ class OStatus
}
}
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT, Post\Media::UNKNOWN]) as $attachment) {
foreach (Post\Media::getByURIId($item['uri-id'], [Post\Media::DOCUMENT, Post\Media::TORRENT]) as $attachment) {
$attributes = ['rel' => 'enclosure',
'href' => $attachment['url'],
'type' => $attachment['mimetype']];