mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 09:34:26 +02:00
Merge branch 'develop' into introduce-phpmd
This commit is contained in:
commit
f1af52baa1
100 changed files with 19158 additions and 18342 deletions
|
@ -233,6 +233,14 @@ class Item
|
|||
|
||||
$content_fields = ['raw-body' => trim($fields['raw-body'] ?? $fields['body'])];
|
||||
|
||||
if ($item['origin'] && empty($item['quote-uri-id'])) {
|
||||
$quote_id = Post\Media::getActivityUriId($item['uri-id']);
|
||||
if (!empty($quote_id)) {
|
||||
Logger::notice('Found attached post', ['id' => $quote_id, 'guid' => $item['guid'], 'uri-id' => $item['uri-id']]);
|
||||
$content_fields['quote-uri-id'] = $quote_id;
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all media attachments from the body and store them in the post-media table
|
||||
// @todo On shared postings (Diaspora style and commented reshare) don't fetch content from the shared part
|
||||
$content_fields['raw-body'] = Post\Media::insertFromBody($item['uri-id'], $content_fields['raw-body']);
|
||||
|
@ -1221,6 +1229,14 @@ class Item
|
|||
Post\Media::insertFromAttachment($item['uri-id'], $item['attach']);
|
||||
}
|
||||
|
||||
if ($item['origin'] && empty($item['quote-uri-id'])) {
|
||||
$quote_id = Post\Media::getActivityUriId($item['uri-id']);
|
||||
if (!empty($quote_id)) {
|
||||
Logger::notice('Found attached post', ['id' => $quote_id, 'guid' => $item['guid'], 'uri-id' => $item['uri-id']]);
|
||||
$item['quote-uri-id'] = $quote_id;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($item['event-id'])) {
|
||||
unset($item['event-id']);
|
||||
|
||||
|
@ -4252,9 +4268,10 @@ class Item
|
|||
}
|
||||
|
||||
/**
|
||||
* Fetch the uri-id of a quote
|
||||
* Fetch the uri-id of a quoted post by searching for data in the body or attached media
|
||||
*
|
||||
* @param string $body
|
||||
* @param string $body The body of the
|
||||
* @param int $uid The id of the user
|
||||
* @return integer
|
||||
*/
|
||||
public static function getQuoteUriId(string $body, int $uid = 0): int
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue