mirror of
https://github.com/friendica/friendica
synced 2024-11-10 07:02:54 +00:00
Fix the tag detection for relay posts
This commit is contained in:
parent
3a98b958d3
commit
8fcdd87473
2 changed files with 4 additions and 4 deletions
|
@ -1658,7 +1658,7 @@ class Processor
|
||||||
$tags = Receiver::processTags(JsonLD::fetchElementArray($activity['as:object'], 'as:tag') ?? []);
|
$tags = Receiver::processTags(JsonLD::fetchElementArray($activity['as:object'], 'as:tag') ?? []);
|
||||||
if (!empty($tags)) {
|
if (!empty($tags)) {
|
||||||
foreach ($tags as $tag) {
|
foreach ($tags as $tag) {
|
||||||
if ($tag['type'] != 'Hashtag') {
|
if (($tag['type'] != 'Hashtag') && !strpos($tag['type'], ':Hashtag')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$messageTags[] = ltrim(mb_strtolower($tag['name']), '#');
|
$messageTags[] = ltrim(mb_strtolower($tag['name']), '#');
|
||||||
|
|
|
@ -136,16 +136,16 @@ class Relay
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!self::isWantedLanguage($body)) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope == self::SCOPE_ALL) {
|
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;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue