]> git.mxchange.org Git - friendica.git/commitdiff
Return more data in the announce object
authorMichael <heluecht@pirati.ca>
Wed, 4 Dec 2019 09:36:46 +0000 (09:36 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 4 Dec 2019 09:36:46 +0000 (09:36 +0000)
src/Protocol/ActivityPub/Transmitter.php

index 1686f68dea8079295c52e7b07792f78c834da356..a9f5ed20a1976bab6ae936c52d6da951c2023603 100644 (file)
@@ -1376,17 +1376,17 @@ class Transmitter
                if (empty($announce['comment'])) {
                        // Pure announce, without a quote
                        $data['type'] = 'Announce';
-                       $data['object'] = $announce['id'];
+                       $data['object'] = $announce['object']['uri'];
                        return $data;
                }
 
                // Quote
                $data['type'] = 'Create';
-               $item['body'] = $announce['comment'] . "\n" . $id;
+               $item['body'] = $announce['comment'] . "\n" . $announce['object']['plink'];
                $data['object'] = self::createNote($item);
 
                /// @todo Finally descide how to implement this in AP. This is a possible way:
-               $data['object']['attachment'][] = ['type' => $type, 'id' => $id];
+               $data['object']['attachment'][] = self::createNote($announce['object']);
 
                $data['object']['source']['content'] = $orig_body;
                return $data;
@@ -1417,7 +1417,7 @@ class Transmitter
                        return [];
                }
 
-               $reshared_item = Item::selectFirst(['author-link', 'uri', 'network'], ['guid' => $matches[1]]);
+               $reshared_item = Item::selectFirst([], ['guid' => $matches[1]]);
                if (!DBA::isResult($reshared_item)) {
                        return [];
                }
@@ -1431,7 +1431,7 @@ class Transmitter
                        return [];
                }
 
-               return ['id' => $reshared_item['uri'], 'actor' => $profile, 'comment' => trim($comment)];
+               return ['object' => $reshared_item, 'actor' => $profile, 'comment' => trim($comment)];
        }
 
        /**