- // This check can most likely be removed since we always are having the tags
- if (!$mention) {
- $cnt = preg_match_all('/[\@\!]\[url\=(.*?)\](.*?)\[\/url\]/ism', $item['body'], $matches, PREG_SET_ORDER);
- if ($cnt) {
- foreach ($matches as $mtch) {
- if (Strings::compareLink($owner['url'], $mtch[1])) {
- $mention = true;
- Logger::notice('Mention found in body.', ['mention' => $mtch[2], 'uri' => $item['uri'], 'uid' => $uid, 'id' => $item_id, 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]);
- }
+ $arr = ['item' => $item, 'user' => $owner];
+
+ Hook::callAll('tagged', $arr);
+ } else {
+ $tags = Tag::getByURIId($item['parent-uri-id'], [Tag::MENTION, Tag::EXCLUSIVE_MENTION]);
+ foreach ($tags as $tag) {
+ if (Strings::compareLink($owner['url'], $tag['url'])) {
+ $mention = true;
+ Logger::info('Mention found in parent tag.', ['url' => $tag['url'], 'uri' => $item['uri'], 'uid' => $uid, 'id' => $item_id, 'uri-id' => $item['uri-id'], 'guid' => $item['guid']]);