]> git.mxchange.org Git - friendica.git/commitdiff
Display content warning as title if collapsing is deactivated
authorHypolite Petovan <mrpetovan@gmail.com>
Thu, 5 Apr 2018 02:50:39 +0000 (22:50 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Thu, 5 Apr 2018 03:08:48 +0000 (23:08 -0400)
include/conversation.php
src/Object/Post.php

index c473d011bed138ff10c20ea1e8c51d1ea6cacfc6..9647fac35f1e135ad67b1ef2332a7efabae76167 100644 (file)
@@ -756,7 +756,13 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
                                list($categories, $folders) = get_cats_and_terms($item);
 
                                $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;
                                $tags_e = $tags;
                                $hashtags_e = $hashtags;
@@ -781,7 +787,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false, $order =
                                        'sparkle' => $sparkle,
                                        'lock' => $lock,
                                        'thumb' => System::removedBaseUrl(proxy_url($item['author-thumb'], false, PROXY_SIZE_THUMB)),
-                                       'title' => $item['title_e'],
+                                       'title' => $title_e,
                                        'body' => $body_e,
                                        'tags' => $tags_e,
                                        'hashtags' => $hashtags_e,
index ecc6956be7c6ff8fffeeaca5b9380002ec2c807b..f47efbecd24ac4ffbe4f5da53600f97f83b2b25a 100644 (file)
@@ -316,7 +316,13 @@ class Post extends BaseObject
                $body_e       = $body;
                $text_e       = strip_tags($body);
                $name_e       = $profile_name;
-               $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'];
+               }
+
                $location_e   = $location;
                $owner_name_e = $this->getOwnerName();