From dfcf1b1e6f6c89f412ffe8ee6bd6404408879d6e Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 16 Mar 2019 08:46:33 +0000 Subject: [PATCH] We now send a summary via AP. This partially fixes the problem with Mastodon and Articles --- src/Protocol/ActivityPub/Transmitter.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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') { -- 2.39.5