From: Michael Date: Sat, 16 Mar 2019 08:46:33 +0000 (+0000) Subject: We now send a summary via AP. This partially fixes the problem with Mastodon and... X-Git-Tag: 2019.03^2~16^2~2 X-Git-Url: https://reisub.nsupdate.info/git/?p=friendica.git%2F.git;a=commitdiff_plain;h=dfcf1b1e6f6c89f412ffe8ee6bd6404408879d6e We now send a summary via AP. This partially fixes the problem with Mastodon and Articles --- diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index d85f67a7cc..79263f8ac0 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -20,6 +20,7 @@ use Friendica\Model\Term; use Friendica\Model\User; use Friendica\Util\DateTimeFormat; use Friendica\Content\Text\BBCode; +use Friendica\Content\Text\Plaintext; use Friendica\Util\JsonLD; use Friendica\Util\LDSignature; use Friendica\Model\Profile; @@ -1020,7 +1021,7 @@ class Transmitter return $data; } - $data['summary'] = null; // Ignore by now + $data['summary'] = BBCode::getAbstract($item['body'], Protocol::ACTIVITYPUB); if ($item['uri'] != $item['thr-parent']) { $data['inReplyTo'] = $item['thr-parent']; @@ -1054,6 +1055,8 @@ class Transmitter if ($type == 'Note') { $body = self::removePictures($body); + } elseif (($type == 'Article') && empty($data['summary'])) { + $data['summary'] = Plaintext::shorten(self::removePictures($body), 1000); } if ($type == 'Event') {