From: Michael Date: Wed, 2 Aug 2023 21:48:31 +0000 (+0000) Subject: Fix the tag detection for relay posts X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8fcdd87473a46e9c79b99bb45aeaac0119ed6fe5;p=friendica.git Fix the tag detection for relay posts --- diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index a76ef6307b..3d020a7472 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -1658,7 +1658,7 @@ class Processor $tags = Receiver::processTags(JsonLD::fetchElementArray($activity['as:object'], 'as:tag') ?? []); if (!empty($tags)) { foreach ($tags as $tag) { - if ($tag['type'] != 'Hashtag') { + if (($tag['type'] != 'Hashtag') && !strpos($tag['type'], ':Hashtag')) { continue; } $messageTags[] = ltrim(mb_strtolower($tag['name']), '#'); diff --git a/src/Protocol/Relay.php b/src/Protocol/Relay.php index ae8ecbbb24..2002aa9bb8 100644 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@ -136,16 +136,16 @@ class Relay } if (!self::isWantedLanguage($body)) { - Logger::info('Unwanted or Undetected language found - rejected', ['network' => $network, 'url' => $url, 'causer' => $causer]); + Logger::info('Unwanted or Undetected language found - rejected', ['network' => $network, 'url' => $url, 'causer' => $causer, 'tags' => $tags]); return false; } if ($scope == self::SCOPE_ALL) { - Logger::info('Server accept all posts - accepted', ['network' => $network, 'url' => $url, 'causer' => $causer]); + Logger::info('Server accept all posts - accepted', ['network' => $network, 'url' => $url, 'causer' => $causer, 'tags' => $tags]); return true; } - Logger::info('No matching hashtags found - rejected', ['network' => $network, 'url' => $url, 'causer' => $causer]); + Logger::info('No matching hashtags found - rejected', ['network' => $network, 'url' => $url, 'causer' => $causer, 'tags' => $tags]); return false; }