Fix missing attached links in posts

This commit is contained in:
Michael 2023-03-04 19:04:37 +00:00
parent 11527761d7
commit b761760d65
10 changed files with 80 additions and 0 deletions

View file

@ -1639,6 +1639,8 @@ class Transmitter
$real_quote = false;
$item = Post\Media::addHTMLAttachmentToItem($item);
$body = $item['body'];
if ($type == 'Note') {

View file

@ -774,6 +774,7 @@ class DFRN
}
$body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item));
$body = Post\Media::addHTMLAttachmentToBody($item['uri-id'], $body);
if ($item['private'] == Item::PRIVATE) {
$body = Item::fixPrivatePhotos($body, $owner['uid'], $item, $cid);

View file

@ -3326,6 +3326,7 @@ class Diaspora
$title = $item['title'];
$body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item), $attach_media);
$body = Post\Media::addHTMLLinkToBody($item['uri-id'], $body);
// Fetch the title from an attached link - if there is one
if (empty($item['title']) && DI::pConfig()->get($owner['uid'], 'system', 'attach_link_title')) {
@ -3585,6 +3586,7 @@ class Diaspora
}
$body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item));
$body = Post\Media::addHTMLLinkToBody($item['uri-id'], $body);
// The replied to autor mention is prepended for clarity if:
// - Item replied isn't yours

View file

@ -1124,6 +1124,7 @@ class Feed
XML::addElement($doc, $entry, 'title', html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
$body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item));
$body = Post\Media::addHTMLAttachmentToBody($item['uri-id'], $body);
$body = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);

View file

@ -1515,6 +1515,7 @@ class OStatus
XML::addElement($doc, $entry, 'title', html_entity_decode($title, ENT_QUOTES, 'UTF-8'));
$body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item));
$body = Post\Media::addHTMLAttachmentToBody($item['uri-id'], $body);
if (!empty($item['title'])) {
$body = '[b]' . $item['title'] . "[/b]\n\n" . $body;