mirror of
https://github.com/friendica/friendica
synced 2025-04-24 08:30:11 +00:00
Detect linked posts and add them as quote
This commit is contained in:
parent
1585f711ee
commit
f8f0dfa91a
6 changed files with 115 additions and 23 deletions
|
@ -170,7 +170,7 @@ class Processor
|
|||
}
|
||||
|
||||
/**
|
||||
* Stire attachment data
|
||||
* Store attachment data
|
||||
*
|
||||
* @param array $activity
|
||||
* @param array $item
|
||||
|
@ -187,7 +187,7 @@ class Processor
|
|||
}
|
||||
|
||||
/**
|
||||
* Store attachment data
|
||||
* Store question data
|
||||
*
|
||||
* @param array $activity
|
||||
* @param array $item
|
||||
|
|
|
@ -1674,13 +1674,8 @@ class Transmitter
|
|||
}
|
||||
$data['quoteUrl'] = $item['quote-uri'];
|
||||
} elseif (!empty($item['quote-uri']) && !Diaspora::isReshare($body, false)) {
|
||||
$fields = ['uri-id', 'uri', 'body', 'title', 'author-name', 'author-link', 'author-avatar', 'guid', 'created', 'plink', 'network'];
|
||||
$shared_item = Post::selectFirst($fields, ['uri-id' => $item['quote-uri-id']]);
|
||||
if (!empty($shared_item['uri-id'])) {
|
||||
$shared_item['body'] = Post\Media::addAttachmentsToBody($shared_item['uri-id'], $shared_item['body']);
|
||||
$body .= "\n" . DI::contentItem()->createSharedBlockByArray($shared_item);
|
||||
$item['body'] = Item::improveSharedDataInBody($item, true);
|
||||
}
|
||||
$body .= "\n" . DI::contentItem()->createSharedPostByUriId($item['quote-uri-id'], $item['uid'], true);
|
||||
$item['body'] = Item::improveSharedDataInBody($item, true);
|
||||
}
|
||||
|
||||
$data['content'] = BBCode::convertForUriId($item['uri-id'], $body, BBCode::ACTIVITYPUB);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue