]> git.mxchange.org Git - friendica.git/commitdiff
We now send a summary via AP. This partially fixes the problem with Mastodon and...
authorMichael <heluecht@pirati.ca>
Sat, 16 Mar 2019 08:46:33 +0000 (08:46 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 16 Mar 2019 08:46:33 +0000 (08:46 +0000)
src/Protocol/ActivityPub/Transmitter.php

index d85f67a7ccf126638517ac684a604bf207e4f1a7..79263f8ac06a705b5e1748530b9e5b0dc35fceb3 100644 (file)
@@ -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') {