From da349a1814d3a474ca7a1c9cf3edf1740adf6e4f Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 22 Jul 2020 05:16:57 +0000 Subject: [PATCH] Store copy on activities --- src/Model/Item.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Model/Item.php b/src/Model/Item.php index afecc41162..70e6d7cea8 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -3015,6 +3015,14 @@ class Item return false; } + if (!Item::exists(['uri-id' => $item['parent-uri-id'], 'uid' => $uid])) { + $parent_item = self::selectFirst(self::ITEM_FIELDLIST, ['uri-id' => $item['parent-uri-id'], 'uid' => 0]); + if (!empty($parent_item) && ($parent_item['private'] =! self::PRIVATE)) { + $stored = self::storeForUser($parent_item, $uid); + Logger::info('Public item stored for user', ['uri-id' => $parent_item['uri-id'], 'uid' => $uid, 'stored' => $stored]); + } + } + // Retrieves the local post owner $owner_self_contact = DBA::selectFirst('contact', [], ['uid' => $uid, 'self' => true]); if (!DBA::isResult($owner_self_contact)) {