]> git.mxchange.org Git - friendica.git/commitdiff
Fix commenting on mobile to Diaspora
authorMichael <heluecht@pirati.ca>
Mon, 31 May 2021 19:39:50 +0000 (19:39 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 31 May 2021 19:39:50 +0000 (19:39 +0000)
mod/item.php
src/Model/Item.php
src/Protocol/Diaspora.php

index 71793f14dc44a6bdc389b6fd1d052d921811a18a..b1973147cd0fe5d933e03ef5c8f2e35e259af1d5 100644 (file)
@@ -713,13 +713,6 @@ function item_post(App $a) {
        unset($datarray['self']);
        unset($datarray['api_source']);
 
-       if ($origin) {
-               $signed = Diaspora::createCommentSignature($uid, $datarray);
-               if (!empty($signed)) {
-                       $datarray['diaspora_signed_text'] = json_encode($signed);
-               }
-       }
-
        $post_id = Item::insert($datarray);
 
        if (!$post_id) {
index 0ca1138f9ea129c9b10262d21b06c5549924b475..7d0a2d026911b48808618e74ada97d684ba357d2 100644 (file)
@@ -1060,7 +1060,14 @@ class Item
                        Post\Content::insert($item['uri-id'], $item);
                }
 
-               // Diaspora signature
+               // Create Diaspora signature
+               if ($item['origin'] && empty($item['diaspora_signed_text'])) {
+                       $signed = Diaspora::createCommentSignature($uid, $item);
+                       if (!empty($signed)) {
+                               $item['diaspora_signed_text'] = json_encode($signed);
+                       }
+               }
+
                if (!empty($item['diaspora_signed_text'])) {
                        DBA::replace('diaspora-interaction', ['uri-id' => $item['uri-id'], 'interaction' => $item['diaspora_signed_text']]);
                }
index 00da7d3915d2dd68d0f7c6013af0472c5f4b3c8e..ce11a8370c3d2de5729718a7432c3ff308b40cf7 100644 (file)
@@ -4049,13 +4049,6 @@ class Diaspora
                        return false;
                }
 
-               $parent = Post::selectFirst(['parent-uri'], ['uri' => $item['thr-parent']]);
-               if (!DBA::isResult($parent)) {
-                       return;
-               }
-
-               $item['parent-uri'] = $parent['parent-uri'];
-
                $message = self::constructComment($item, $owner);
                if ($message === false) {
                        return false;