Transmit the quoted part in the source
This commit is contained in:
parent
8cec89195b
commit
4dd2d7ebab
|
@ -597,7 +597,7 @@ class Item
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $body . "\n" . $this->createSharedBlockByArray($shared_item, true);
|
return BBCode::removeSharedData($body) . "\n" . $this->createSharedBlockByArray($shared_item, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -748,6 +748,8 @@ class Item
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$body = BBCode::removeSharedData($body);
|
||||||
|
|
||||||
$body .= "\n♲ " . ($post['plink'] ?: $post['uri']);
|
$body .= "\n♲ " . ($post['plink'] ?: $post['uri']);
|
||||||
|
|
||||||
return $body;
|
return $body;
|
||||||
|
|
|
@ -220,10 +220,7 @@ class Item
|
||||||
$content_fields['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $content_fields['raw-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']);
|
$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);
|
Post\Content::update($item['uri-id'], $content_fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1148,9 +1145,7 @@ class Item
|
||||||
$item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']);
|
$item['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $item['raw-body']);
|
||||||
$item['raw-body'] = self::setHashtags($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
|
// Check for hashtags in the body and repair or add hashtag links
|
||||||
$item['body'] = self::setHashtags($item['body']);
|
$item['body'] = self::setHashtags($item['body']);
|
||||||
|
|
|
@ -1667,7 +1667,6 @@ class Transmitter
|
||||||
$body = BBCode::setMentionsToNicknames($body);
|
$body = BBCode::setMentionsToNicknames($body);
|
||||||
|
|
||||||
if (!empty($item['quote-uri-id'])) {
|
if (!empty($item['quote-uri-id'])) {
|
||||||
$body = BBCode::removeSharedData($body);
|
|
||||||
if (Post::exists(['uri-id' => $item['quote-uri-id'], 'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN]])) {
|
if (Post::exists(['uri-id' => $item['quote-uri-id'], 'network' => [Protocol::ACTIVITYPUB, Protocol::DFRN]])) {
|
||||||
$real_quote = true;
|
$real_quote = true;
|
||||||
$data['quoteUrl'] = $item['quote-uri'];
|
$data['quoteUrl'] = $item['quote-uri'];
|
||||||
|
@ -1687,7 +1686,6 @@ class Transmitter
|
||||||
if (!empty($language)) {
|
if (!empty($language)) {
|
||||||
$richbody = BBCode::setMentionsToNicknames($item['body'] ?? '');
|
$richbody = BBCode::setMentionsToNicknames($item['body'] ?? '');
|
||||||
if (!empty($item['quote-uri-id'])) {
|
if (!empty($item['quote-uri-id'])) {
|
||||||
$richbody = BBCode::removeSharedData($richbody);
|
|
||||||
if ($real_quote) {
|
if ($real_quote) {
|
||||||
$richbody = DI::contentItem()->addShareLink($richbody, $item['quote-uri-id']);
|
$richbody = DI::contentItem()->addShareLink($richbody, $item['quote-uri-id']);
|
||||||
} else {
|
} else {
|
||||||
|
@ -1699,7 +1697,13 @@ class Transmitter
|
||||||
$data['contentMap'][$language] = BBCode::convertForUriId($item['uri-id'], $richbody, BBCode::EXTERNAL);
|
$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'])) {
|
if (!empty($item['signed_text']) && ($item['uri'] != $item['thr-parent'])) {
|
||||||
$data['diaspora:comment'] = $item['signed_text'];
|
$data['diaspora:comment'] = $item['signed_text'];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user