]> git.mxchange.org Git - friendica.git/commitdiff
Don't create automated summaries
authorMichael <heluecht@pirati.ca>
Sat, 22 May 2021 16:11:10 +0000 (16:11 +0000)
committerMichael <heluecht@pirati.ca>
Sat, 22 May 2021 16:11:10 +0000 (16:11 +0000)
src/Protocol/ActivityPub/Transmitter.php

index 4e009d61d456622d98b8c6bd11add84850a78103..83e3d35a9782c971ec4b84d085aaefdf27995c3b 100644 (file)
@@ -1525,12 +1525,21 @@ class Transmitter
 
                if ($type == 'Note') {
                        $body = $item['raw-body'] ?? self::removePictures($body);
-               } elseif (($type == 'Article') && empty($data['summary'])) {
-                       $regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
-                       $summary = preg_replace_callback($regexp, ['self', 'mentionAddrCallback'], $body);
-                       $data['summary'] = BBCode::toPlaintext(Plaintext::shorten(self::removePictures($summary), 1000));
                }
 
+               /**
+                * @todo Improve the automated summary
+                * This part is currently deactivated. The automated summary seems to be more
+                * confusing than helping. But possibly we will find a better way.
+                * So the code is left here for now as a reminder
+                * 
+                * } elseif (($type == 'Article') && empty($data['summary'])) {
+                *              $regexp = "/[@!]\[url\=([^\[\]]*)\].*?\[\/url\]/ism";
+                *              $summary = preg_replace_callback($regexp, ['self', 'mentionAddrCallback'], $body);
+                *              $data['summary'] = BBCode::toPlaintext(Plaintext::shorten(self::removePictures($summary), 1000));
+                * }
+                */
+
                if (empty($item['uid']) || !Feature::isEnabled($item['uid'], 'explicit_mentions')) {
                        $body = self::prependMentions($body, $item['uri-id'], $item['author-link']);
                }