X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FObject%2FPost.php;h=4e0d8d238923d37b77d0cf1e2dab14191d441060;hb=2438eb78dd0f8014a947c1df1cf5b862e4ac285e;hp=bbd1e9ce1c037bb73dec3e9435af5020f115a6ea;hpb=bed1139093c5e330eebfc8bd7b72af4894e363cd;p=friendica.git diff --git a/src/Object/Post.php b/src/Object/Post.php index bbd1e9ce1c..4e0d8d2389 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -389,10 +389,12 @@ class Post list($categories, $folders) = DI::contentItem()->determineCategoriesTerms($item, local_user()); - if (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { + if (!empty($item['title'])) { + $title = $item['title']; + } elseif (!empty($item['content-warning']) && DI::pConfig()->get(local_user(), 'system', 'disable_cw', false)) { $title = ucfirst($item['content-warning']); } else { - $title = $item['title']; + $title = ''; } if (DI::pConfig()->get(local_user(), 'system', 'hide_dislike')) { @@ -891,22 +893,26 @@ class Post $owner = User::getOwnerDataById($a->getLoggedInUserId()); - if (!Feature::isEnabled(local_user(), 'explicit_mentions')) { - return ''; - } - - $item = PostModel::selectFirst(['author-addr', 'uri-id', 'network', 'gravity'], ['id' => $this->getId()]); + $item = PostModel::selectFirst(['author-addr', 'uri-id', 'network', 'gravity', 'content-warning'], ['id' => $this->getId()]); if (!DBA::isResult($item) || empty($item['author-addr'])) { // Should not happen return ''; } - if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) { - $text = '@' . $item['author-addr'] . ' '; + if (!empty($item['content-warning']) && Feature::isEnabled(local_user(), 'add_abstract')) { + $text = '[abstract=' . Protocol::ACTIVITYPUB . ']' . $item['content-warning'] . "[/abstract]\n"; } else { $text = ''; } + if (!Feature::isEnabled(local_user(), 'explicit_mentions')) { + return $text; + } + + if (($item['author-addr'] != $owner['addr']) && (($item['gravity'] != GRAVITY_PARENT) || !in_array($item['network'], [Protocol::DIASPORA]))) { + $text .= '@' . $item['author-addr'] . ' '; + } + $terms = Tag::getByURIId($item['uri-id'], [Tag::MENTION, Tag::IMPLICIT_MENTION, Tag::EXCLUSIVE_MENTION]); foreach ($terms as $term) { if (!$term['url']) {