X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FRelay.php;h=7d62ba576ea73620739b30b079a7cda7bd184572;hb=5b2b73da92ca91128fd5d657eb0342b71b4d4da3;hp=e7ecea43f857d64573958ae2d415559ba501b39a;hpb=ec16e7c0e6349d7080f634177ef943b446be3735;p=friendica.git diff --git a/src/Protocol/Relay.php b/src/Protocol/Relay.php index e7ecea43f8..7d62ba576e 100644 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@ -179,11 +179,6 @@ class Relay */ public static function isWantedLanguage(string $body, int $uri_id = 0, int $author_id = 0, array $languages = []) { - if (empty($languages) && (empty($body) || Smilies::isEmojiPost($body))) { - Logger::debug('Empty body or only emojis', ['body' => $body]); - return true; - } - $detected = []; $quality = DI::config()->get('system', 'relay_language_quality'); foreach (Item::getLanguageArray($body, DI::config()->get('system', 'relay_languages'), $uri_id, $author_id) as $language => $reliability) { @@ -192,6 +187,11 @@ class Relay } } + if (empty($languages) && empty($detected) && (empty($body) || Smilies::isEmojiPost($body))) { + Logger::debug('Empty body or only emojis', ['body' => $body]); + return true; + } + if (!empty($languages) || !empty($detected)) { $cachekey = 'relay:isWantedLanguage'; $user_languages = DI::cache()->get($cachekey);