]> git.mxchange.org Git - friendica.git/commitdiff
Fix the tag detection for relay posts
authorMichael <heluecht@pirati.ca>
Wed, 2 Aug 2023 21:48:31 +0000 (21:48 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 2 Aug 2023 21:48:31 +0000 (21:48 +0000)
src/Protocol/ActivityPub/Processor.php
src/Protocol/Relay.php

index a76ef6307bd939c9ef6ceda39a378969c47956b9..3d020a747223bf91a5e4b8c7da28e9211ba28885 100644 (file)
@@ -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']), '#');
index ae8ecbbb24c0c207776cd9f0bcff85e20c784188..2002aa9bb8cb3426fdc51e5b642a20d05eeed749 100644 (file)
@@ -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;
        }