From 9887f2c3d097208680d759388660d1fbfbeebb96 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 8 Feb 2019 23:07:36 -0500 Subject: [PATCH] Toggle explicit mentions in comment boxes with explicit_mentions config --- src/Object/Post.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Object/Post.php b/src/Object/Post.php index 6e2483c6a0..36451c854f 100644 --- a/src/Object/Post.php +++ b/src/Object/Post.php @@ -6,6 +6,7 @@ namespace Friendica\Object; use Friendica\BaseObject; use Friendica\Content\ContactSelector; +use Friendica\Content\Feature; use Friendica\Core\Addon; use Friendica\Core\Config; use Friendica\Core\Hook; @@ -772,13 +773,18 @@ class Post extends BaseObject * Get default text for the comment box * * @return string + * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ private function getDefaultText() { $a = self::getApp(); if (!local_user() || empty($a->profile['addr'])) { - return; + return ''; + } + + if (!Feature::isEnabled(local_user(), 'explicit_mentions')) { + return ''; } $item = Item::selectFirst(['author-addr'], ['id' => $this->getId()]);