From: Michael Date: Wed, 4 Dec 2019 09:36:46 +0000 (+0000) Subject: Return more data in the announce object X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8f4f3e00e2ea1cb71cca251551058a8515c1743e;p=friendica.git Return more data in the announce object --- diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 1686f68dea..a9f5ed20a1 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -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)]; } /**