]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Issue 8605: "show less" now displays "show less"
[friendica.git] / mod / item.php
index f192d9525a0e56489400938dc3ec95ee29031bb8..6864dabacd6c367385791f087a1a654e39810c52 100644 (file)
@@ -81,8 +81,6 @@ function item_post(App $a) {
 
        $api_source = $_REQUEST['api_source'] ?? false;
 
-       $message_id = ((!empty($_REQUEST['message_id']) && $api_source) ? strip_tags($_REQUEST['message_id']) : '');
-
        $return_path = $_REQUEST['return'] ?? '';
        $preview = intval($_REQUEST['preview'] ?? 0);
 
@@ -176,14 +174,6 @@ function item_post(App $a) {
                $profile_uid = $toplevel_user_id;
        }
 
-       // Check for multiple posts with the same message id (when the post was created via API)
-       if (($message_id != '') && ($profile_uid != 0)) {
-               if (Item::exists(['uri' => $message_id, 'uid' => $profile_uid])) {
-                       Logger::info('Message already exists for user', ['uri' => $message_id, 'uid' => $profile_uid]);
-                       return 0;
-               }
-       }
-
        // Allow commenting if it is an answer to a public post
        $allow_comment = local_user() && ($profile_uid == 0) && $toplevel_item_id && in_array($toplevel_item['network'], Protocol::FEDERATED);
 
@@ -562,7 +552,7 @@ function item_post(App $a) {
                $origin = $_REQUEST['origin'];
        }
 
-       $uri = ($message_id ? $message_id : Item::newURI($api_source ? $profile_uid : $uid, $guid));
+       $uri = Item::newURI($api_source ? $profile_uid : $uid, $guid);
 
        // Fallback so that we alway have a parent uri
        if (!$thr_parent_uri || !$toplevel_item_id) {
@@ -628,7 +618,7 @@ function item_post(App $a) {
        $datarray['api_source'] = $api_source;
 
        // This field is for storing the raw conversation data
-       $datarray['protocol'] = Conversation::PARCEL_DFRN;
+       $datarray['protocol'] = Conversation::PARCEL_DIRECT;
 
        $conversation = DBA::selectFirst('conversation', ['conversation-uri', 'conversation-href'], ['item-uri' => $datarray['thr-parent']]);
        if (DBA::isResult($conversation)) {