mirror of
https://github.com/friendica/friendica
synced 2025-04-26 01:50:11 +00:00
Don't always fetch parent posts
This commit is contained in:
parent
23ef4a99bb
commit
3463e34693
3 changed files with 19 additions and 14 deletions
|
@ -265,12 +265,15 @@ class Processor
|
|||
/**
|
||||
* Prepares data for a message
|
||||
*
|
||||
* @param array $activity Activity array
|
||||
* @param array $activity Activity array
|
||||
* @param bool $fetch_parents
|
||||
*
|
||||
* @return array Internal item
|
||||
*
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
* @throws \ImagickException
|
||||
*/
|
||||
public static function createItem(array $activity): array
|
||||
public static function createItem(array $activity, bool $fetch_parents = true): array
|
||||
{
|
||||
$item = [];
|
||||
$item['verb'] = Activity::POST;
|
||||
|
@ -305,7 +308,7 @@ class Processor
|
|||
return [];
|
||||
}
|
||||
|
||||
if (empty($activity['directmessage']) && ($activity['id'] != $activity['reply-to-id']) && !Post::exists(['uri' => $activity['reply-to-id']])) {
|
||||
if ($fetch_parents && empty($activity['directmessage']) && ($activity['id'] != $activity['reply-to-id']) && !Post::exists(['uri' => $activity['reply-to-id']])) {
|
||||
$result = self::fetchParent($activity);
|
||||
if (!empty($result)) {
|
||||
if (($item['thr-parent'] != $result) && Post::exists(['uri' => $result])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue