allow forum delivery using attached mention tags (as well as mentions in the body)

This commit is contained in:
nobody 2020-09-11 02:12:09 -07:00
parent ee8689cc89
commit 0c026be2c1

View file

@ -29,6 +29,7 @@ use Friendica\Core\Protocol;
use Friendica\Core\Renderer; use Friendica\Core\Renderer;
use Friendica\Core\Session; use Friendica\Core\Session;
use Friendica\Core\System; use Friendica\Core\System;
use Friendica\Core\Tag;
use Friendica\Core\Worker; use Friendica\Core\Worker;
use Friendica\Database\DBA; use Friendica\Database\DBA;
use Friendica\Database\DBStructure; use Friendica\Database\DBStructure;
@ -2670,6 +2671,16 @@ class Item
} }
} }
if (!$mention) {
$tags = Tag::getByURIId($item_id, [Tag::MENTION, Tag::EXCLUSIVE_MENTION]);
$foreach ($tags as $tag) {
if (Strings::compareLink($link, $tag['url']) || Strings::compareLink($dlink, $tag['url'])) {
$mention = true;
Logger::log('mention found in tag: ' . $tag['url']);
}
}
}
if (!$mention) { if (!$mention) {
if (($community_page || $prvgroup) && if (($community_page || $prvgroup) &&
!$item['wall'] && !$item['origin'] && ($item['gravity'] == GRAVITY_PARENT)) { !$item['wall'] && !$item['origin'] && ($item['gravity'] == GRAVITY_PARENT)) {