]> git.mxchange.org Git - friendica.git/commitdiff
Issue 13221: Diaspora posts are now stored correctly
authorMichael <heluecht@pirati.ca>
Mon, 26 Jun 2023 19:44:14 +0000 (19:44 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 26 Jun 2023 19:44:14 +0000 (19:44 +0000)
src/Protocol/Diaspora.php

index abe56cb9a1e6f600feee1d2d5c092188cac7ac70..dd6c2115b5e32714a868bae0ee589465ca76bf31 100644 (file)
@@ -2654,7 +2654,7 @@ class Diaspora
 
                $datarray = [
                        'guid'        => $guid,
-                       'uri-id'      => ItemURI::insert(['uri' => $guid, 'guid' => $guid]),
+                       'plink'       => self::plink($author, $guid),
                        'uid'         => $importer['uid'],
                        'contact-id'  => $contact['id'],
                        'network'     => Protocol::DIASPORA,
@@ -2672,9 +2672,12 @@ class Diaspora
                        'post-type'   => Item::PT_NOTE,
                ];
 
-               $datarray['guid'] = $guid;
-               $datarray['uri'] = $datarray['thr-parent'] = self::getUriFromGuid($guid, $author);
-               $datarray['uri-id'] = ItemURI::insert(['uri' => $datarray['uri'], 'guid' => $datarray['guid']]);
+               $datarray['uri']        = $datarray['thr-parent'] = self::getUriFromGuid($guid, $author);
+               $datarray['uri-id']     = ItemURI::insert(['uri' => $datarray['uri'], 'guid' => $datarray['guid']]);
+               $datarray['owner-link'] = $datarray['author-link'];
+               $datarray['owner-id']   = $datarray['author-id'];
+
+               $datarray = self::setDirection($datarray, $direction);
 
                // Attach embedded pictures to the body
                if ($data->photo) {
@@ -2709,7 +2712,6 @@ class Diaspora
                        $datarray['app'] = $provider_display_name;
                }
 
-               $datarray['plink'] = self::plink($author, $guid);
                $datarray['changed'] = $datarray['created'] = $datarray['edited'] = $created_at;
 
                if (isset($address['address'])) {