From: Michael Date: Thu, 12 Oct 2023 20:49:20 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/2023.09-rc' into smilies X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=19529e2aa19a41dae560c999f6f3dda4e319d722;p=friendica.git Merge remote-tracking branch 'upstream/2023.09-rc' into smilies --- 19529e2aa19a41dae560c999f6f3dda4e319d722 diff --cc src/Protocol/Relay.php index 8bcced7567,c4432e59a3..bf48352019 --- a/src/Protocol/Relay.php +++ b/src/Protocol/Relay.php @@@ -154,17 -166,14 +167,19 @@@ class Rela * Detect the language of a post and decide if the post should be accepted * * @param string $body + * @param int $uri_id + * @param int $author_id * @return boolean */ - public static function isWantedLanguage(string $body) + public static function isWantedLanguage(string $body, int $uri_id = 0, int $author_id = 0) { + if (empty($body) || Smilies::isEmojiPost($body)) { + Logger::debug('Empty body or only emojis', ['body' => $body]); + return true; + } + $languages = []; - foreach (Item::getLanguageArray($body, 10) as $language => $reliability) { + foreach (Item::getLanguageArray($body, 10, $uri_id, $author_id) as $language => $reliability) { if ($reliability > 0) { $languages[] = $language; }