]> git.mxchange.org Git - friendica.git/commitdiff
Take language from quoted post
authorMichael <heluecht@pirati.ca>
Mon, 8 Jan 2024 06:48:49 +0000 (06:48 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 28 Jan 2024 15:37:43 +0000 (16:37 +0100)
src/Model/Item.php

index f9ccc473fe7887dc282dc6cde10fd4feb74fe209..d49d6e2390d71f6dbf87b0842f3c7b2efe0ad4e3 100644 (file)
@@ -2075,6 +2075,13 @@ class Item
 
                $content = trim(($item['title'] ?? '') . ' ' . ($item['content-warning'] ?? '') . ' ' . ($item['body'] ?? ''));
 
+               if (empty($content) && !empty($item['quote-uri-id'])) {
+                       $quoted = Post::selectFirstPost(['language'], ['uri-id' => $item['quote-uri-id']]);
+                       if (!empty($quoted['language'])) {
+                               return $quoted['language'];
+                       }
+               }
+
                $languages = self::getLanguageArray($content, 3, $item['uri-id'], $item['author-id'], $transmitted);
 
                if (!empty($transmitted)) {