Merge pull request #13238 from annando/issue-13221

Issue 13221: Diaspora posts are now stored correctly
This commit is contained in:
Tobias Diekershoff 2023-06-27 06:17:44 +02:00 committed by GitHub
commit 302619a5de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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