diff --git a/src/Content/Item.php b/src/Content/Item.php index 87d719719b..0d47cde92f 100644 --- a/src/Content/Item.php +++ b/src/Content/Item.php @@ -950,18 +950,19 @@ class Item public function initializePost(array $post): array { - $post['network'] = Protocol::DFRN; - $post['protocol'] = Conversation::PARCEL_DIRECT; - $post['direction'] = Conversation::PUSH; - $post['received'] = DateTimeFormat::utcNow(); - $post['origin'] = true; - $post['wall'] = $post['wall'] ?? true; - $post['guid'] = $post['guid'] ?? System::createUUID(); - $post['verb'] = $post['verb'] ?? Activity::POST; + $post['network'] = Protocol::DFRN; + $post['protocol'] = Conversation::PARCEL_DIRECT; + $post['direction'] = Conversation::PUSH; + $post['received'] = DateTimeFormat::utcNow(); + $post['origin'] = true; + $post['wall'] = $post['wall'] ?? true; + $post['guid'] = $post['guid'] ?? System::createUUID(); + $post['verb'] = $post['verb'] ?? Activity::POST; + $post['uri'] = $post['uri'] ?? ItemModel::newURI($post['guid']); + $post['thr-parent'] = $post['thr-parent'] ?? $post['uri']; - if (empty($post['uri'])) { - $post['thr-parent'] = $post['uri'] = ItemModel::newURI($post['guid']); - $post['gravity'] = ItemModel::GRAVITY_PARENT; + if (empty($post['gravity'])) { + $post['gravity'] = ($post['uri'] == $post['thr-parent']) ? ItemModel::GRAVITY_PARENT : ItemModel::GRAVITY_COMMENT; } $owner = User::getOwnerDataById($post['uid']); diff --git a/src/Factory/Api/Mastodon/Status.php b/src/Factory/Api/Mastodon/Status.php index c120825fd1..0b9c2c554a 100644 --- a/src/Factory/Api/Mastodon/Status.php +++ b/src/Factory/Api/Mastodon/Status.php @@ -210,6 +210,8 @@ class Status extends BaseFactory // We can always safely add attached activities. Real quotes are added to the body via "addSharedPost". if (empty($item['quote-uri-id'])) { $quote = self::createQuote($item, $uid); + } else { + $quote = []; } $shared = $this->contentItem->getSharedPost($item, ['uri-id']);