return $body;
}
- return $body . "\n" . $this->createSharedBlockByArray($shared_item, true);
+ return BBCode::removeSharedData($body) . "\n" . $this->createSharedBlockByArray($shared_item, true);
}
/**
return $body;
}
+ $body = BBCode::removeSharedData($body);
+
$body .= "\n♲ " . ($post['plink'] ?: $post['uri']);
return $body;
$content_fields['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $content_fields['raw-body']);
$content_fields['raw-body'] = self::setHashtags($content_fields['raw-body']);
- if ($item['author-network'] != Protocol::DFRN) {
- Post\Media::insertFromRelevantUrl($item['uri-id'], $content_fields['raw-body']);
- }
-
+ Post\Media::insertFromRelevantUrl($item['uri-id'], $content_fields['raw-body']);
Post\Content::update($item['uri-id'], $content_fields);
}
$item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']);
$item['raw-body'] = self::setHashtags($item['raw-body']);
- if (!DBA::exists('contact', ['id' => $item['author-id'], 'network' => Protocol::DFRN])) {
- Post\Media::insertFromRelevantUrl($item['uri-id'], $item['raw-body']);
- }
+ Post\Media::insertFromRelevantUrl($item['uri-id'], $item['raw-body']);
// Check for hashtags in the body and repair or add hashtag links
$item['body'] = self::setHashtags($item['body']);
$body = BBCode::setMentionsToNicknames($body);
if (!empty($item['quote-uri-id'])) {
- $body = BBCode::removeSharedData($body);
if (Post::exists(['uri-id' => $item['quote-uri-id'], 'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN]])) {
$real_quote = true;
$data['quoteUrl'] = $item['quote-uri'];
if (!empty($language)) {
$richbody = BBCode::setMentionsToNicknames($item['body'] ?? '');
if (!empty($item['quote-uri-id'])) {
- $richbody = BBCode::removeSharedData($richbody);
if ($real_quote) {
$richbody = DI::contentItem()->addShareLink($richbody, $item['quote-uri-id']);
} else {
$data['contentMap'][$language] = BBCode::convertForUriId($item['uri-id'], $richbody, BBCode::EXTERNAL);
}
- $data['source'] = ['content' => $item['body'], 'mediaType' => "text/bbcode"];
+ if (!empty($item['quote-uri-id'])) {
+ $source = DI::contentItem()->addSharedPost($item, $item['body']);
+ } else {
+ $source = $item['body'];
+ }
+
+ $data['source'] = ['content' => $source, 'mediaType' => "text/bbcode"];
if (!empty($item['signed_text']) && ($item['uri'] != $item['thr-parent'])) {
$data['diaspora:comment'] = $item['signed_text'];