Moved the check for a comment to a different place

This commit is contained in:
Michael 2020-05-09 15:50:49 +00:00
parent 19b5b83ac6
commit 258e9df064
2 changed files with 1 additions and 5 deletions

View file

@ -737,7 +737,7 @@ function item_post(App $a) {
Tag::storeFromBody($datarray['uri-id'], $datarray['body']); Tag::storeFromBody($datarray['uri-id'], $datarray['body']);
if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions')) { if (!\Friendica\Content\Feature::isEnabled($uid, 'explicit_mentions') && ($datarray['gravity'] == GRAVITY_COMMENT)) {
Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']); Tag::createImplicitMentions($datarray['uri-id'], $datarray['thr-parent-id']);
} }

View file

@ -333,10 +333,6 @@ class Tag
*/ */
public static function createImplicitMentions(int $uri_id, int $parent_uri_id) public static function createImplicitMentions(int $uri_id, int $parent_uri_id)
{ {
if ($uri_id == $parent_uri_id) {
return;
}
// Always mention the direct parent author // Always mention the direct parent author
$parent = Item::selectFirst(['author-link', 'author-name'], ['uri-id' => $parent_uri_id]); $parent = Item::selectFirst(['author-link', 'author-name'], ['uri-id' => $parent_uri_id]);
self::store($uri_id, self::IMPLICIT_MENTION, $parent['author-name'], $parent['author-link']); self::store($uri_id, self::IMPLICIT_MENTION, $parent['author-name'], $parent['author-link']);