X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=mod%2Fitem.php;h=213a9907898bf0cafa98de592528716c2018bd23;hb=6d1b98dc0e951445e447a60d3ee17368891d17b8;hp=be3af101d9e18f66879c38883579ab1891724014;hpb=880b7177c8430b40336df541eb227d14db8bff7c;p=friendica.git diff --git a/mod/item.php b/mod/item.php index be3af101d9..213a990789 100644 --- a/mod/item.php +++ b/mod/item.php @@ -39,7 +39,7 @@ require_once 'include/items.php'; function item_post(App $a) { if (!local_user() && !remote_user()) { - return; + return 0; } require_once 'include/security.php'; @@ -152,9 +152,9 @@ function item_post(App $a) { // Check for multiple posts with the same message id (when the post was created via API) if (($message_id != '') && ($profile_uid != 0)) { - if (DBA::exists('item', ['uri' => $message_id, 'uid' => $profile_uid])) { + if (Item::exists(['uri' => $message_id, 'uid' => $profile_uid])) { logger("Message with URI ".$message_id." already exists for user ".$profile_uid, LOGGER_DEBUG); - return; + return 0; } } @@ -183,7 +183,7 @@ function item_post(App $a) { $user = DBA::selectFirst('user', [], ['uid' => $profile_uid]); if (!DBA::isResult($user) && !$parent) { - return; + return 0; } $categories = ''; @@ -843,6 +843,10 @@ function item_post(App $a) { logger('post_complete'); + if ($api_source) { + return $post_id; + } + item_post_return(System::baseUrl(), $api_source, $return_path); // NOTREACHED }