Merge pull request #6614 from MrPetovan/task/6552-add-explicit-mentions

Add explicit mentions to ActivityPub/Diaspora comments
This commit is contained in:
Michael Vogel 2019-02-10 00:52:40 +01:00 committed by GitHub
commit c7308d98fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 204 additions and 51 deletions

View file

@ -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;
@ -773,13 +774,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()]);