]> git.mxchange.org Git - friendica.git/commitdiff
Split method Item::insert()
authorArt4 <art4@wlabs.de>
Fri, 27 Dec 2024 11:45:28 +0000 (11:45 +0000)
committerArt4 <art4@wlabs.de>
Fri, 27 Dec 2024 11:45:28 +0000 (11:45 +0000)
src/Model/Item.php

index c9024c9cc6aa7081958a92a37bbe0d347713cfc9..7de856b2f69977bcaa01e69ed31015bc724119d9 100644 (file)
@@ -1329,6 +1329,11 @@ class Item
 
                Logger::notice('created item', ['post-id' => $post_user_id, 'uid' => $item['uid'], 'network' => $item['network'], 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]);
 
+               return self::handleCreatedItem($orig_item, $post_user_id, $uid, $notify, $copy_permissions, $parent_origin, $priority, $notify_type, $inserted);
+       }
+
+       private static function handleCreatedItem(array $orig_item, int $post_user_id, int $uid, int $notify, bool $copy_permissions, $parent_origin, int $priority, string $notify_type, bool $inserted): int
+       {
                $posted_item = Post::selectFirst(self::ITEM_FIELDLIST, ['post-user-id' => $post_user_id]);
                if (!DBA::isResult($posted_item)) {
                        // On failure store the data into a spool file so that the "SpoolPost" worker can try again later.