Merge pull request #14148 from annando/summary

Use the field for the summary instead of the "abstract" element
This commit is contained in:
Hypolite Petovan 2024-05-11 18:14:32 -04:00 committed by GitHub
commit d788cb82cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 7 deletions

View file

@ -121,7 +121,7 @@ class Item
const DELIVER_FIELDLIST = [ const DELIVER_FIELDLIST = [
'uid', 'id', 'parent', 'uri-id', 'uri', 'thr-parent', 'parent-uri', 'guid', 'uid', 'id', 'parent', 'uri-id', 'uri', 'thr-parent', 'parent-uri', 'guid',
'parent-guid', 'conversation', 'received', 'created', 'edited', 'verb', 'object-type', 'object', 'target', 'parent-guid', 'conversation', 'received', 'created', 'edited', 'verb', 'object-type', 'object', 'target',
'private', 'title', 'body', 'raw-body', 'language', 'location', 'coord', 'app', 'sensitive', 'private', 'title', 'content-warning', 'body', 'raw-body', 'language', 'location', 'coord', 'app', 'sensitive',
'inform', 'deleted', 'extid', 'post-type', 'post-reason', 'gravity', 'inform', 'deleted', 'extid', 'post-type', 'post-reason', 'gravity',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
'author-id', 'author-addr', 'author-link', 'author-name', 'author-avatar', 'owner-id', 'owner-link', 'contact-uid', 'author-id', 'author-addr', 'author-link', 'author-name', 'author-avatar', 'owner-id', 'owner-link', 'contact-uid',

View file

@ -1160,11 +1160,11 @@ class Transmitter
// - Moving the title into the "summary" field that is used as a "content warning" // - Moving the title into the "summary" field that is used as a "content warning"
if (!$use_title) { if (!$use_title) {
$mail['body'] = '[abstract]' . $mail['title'] . "[/abstract]\n" . $mail['body']; $mail['content-warning'] = $mail['title'];
$mail['title'] = ''; $mail['title'] = '';
} } else {
$mail['content-warning'] = ''; $mail['content-warning'] = '';
}
$mail['sensitive'] = false; $mail['sensitive'] = false;
$mail['author-link'] = $mail['owner-link'] = $mail['from-url']; $mail['author-link'] = $mail['owner-link'] = $mail['from-url'];
$mail['owner-id'] = $mail['author-id']; $mail['owner-id'] = $mail['author-id'];
@ -1780,7 +1780,7 @@ class Transmitter
return $data; return $data;
} }
$data['summary'] = BBCode::toPlaintext(BBCode::getAbstract($item['body'], Protocol::ACTIVITYPUB)); $data['summary'] = $item['content-warning'] ?: BBCode::toPlaintext(BBCode::getAbstract($item['body'], Protocol::ACTIVITYPUB));
if ($item['uri'] != $item['thr-parent']) { if ($item['uri'] != $item['thr-parent']) {
$data['inReplyTo'] = $item['thr-parent']; $data['inReplyTo'] = $item['thr-parent'];

View file

@ -674,7 +674,7 @@ class Feed
} }
} else { } else {
if (!empty($summary)) { if (!empty($summary)) {
$item['body'] = '[abstract]' . HTML::toBBCode($summary, $basepath) . "[/abstract]\n" . $item['body']; $item['content-warning'] = HTML::toBBCode($summary, $basepath);
} }
if ($fetch_further_information == LocalRelationship::FFI_KEYWORD) { if ($fetch_further_information == LocalRelationship::FFI_KEYWORD) {