Display content warning as title if collapsing is deactivated

This commit is contained in:
Hypolite Petovan 2018-04-04 22:50:39 -04:00
parent 296f561878
commit 41db5f0912
2 changed files with 15 additions and 3 deletions

View file

@ -756,7 +756,13 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
list($categories, $folders) = get_cats_and_terms($item); list($categories, $folders) = get_cats_and_terms($item);
$profile_name_e = $profile_name; $profile_name_e = $profile_name;
$item['title_e'] = $item['title'];
if (!empty($item['content-warning']) && PConfig::get(local_user(), 'social', 'disable_cw', false)) {
$title_e = ucfirst($item['content-warning']);
} else {
$title_e = $item['title'];
}
$body_e = $body; $body_e = $body;
$tags_e = $tags; $tags_e = $tags;
$hashtags_e = $hashtags; $hashtags_e = $hashtags;
@ -781,7 +787,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
'sparkle' => $sparkle, 'sparkle' => $sparkle,
'lock' => $lock, 'lock' => $lock,
'thumb' => System::removedBaseUrl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)), 'thumb' => System::removedBaseUrl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
'title' => $item['title_e'], 'title' => $title_e,
'body' => $body_e, 'body' => $body_e,
'tags' => $tags_e, 'tags' => $tags_e,
'hashtags' => $hashtags_e, 'hashtags' => $hashtags_e,

View file

@ -316,7 +316,13 @@ class Post extends BaseObject
$body_e = $body; $body_e = $body;
$text_e = strip_tags($body); $text_e = strip_tags($body);
$name_e = $profile_name; $name_e = $profile_name;
if (!empty($item['content-warning']) && PConfig::get(local_user(), 'social', 'disable_cw', false)) {
$title_e = ucfirst($item['content-warning']);
} else {
$title_e = $item['title']; $title_e = $item['title'];
}
$location_e = $location; $location_e = $location;
$owner_name_e = $this->getOwnerName(); $owner_name_e = $this->getOwnerName();