mirror of
https://github.com/friendica/friendica
synced 2025-04-25 02:30:11 +00:00
Only use posts with wanted languages for subscribed tags
This commit is contained in:
parent
541208a6bd
commit
14266a1ca4
4 changed files with 34 additions and 5 deletions
|
@ -426,7 +426,7 @@ class Timeline extends BaseModule
|
|||
private function addLanguageCondition(int $uid, array $condition): array
|
||||
{
|
||||
$conditions = [];
|
||||
$languages = $this->pConfig->get($uid, 'channel', 'languages', [User::getLanguageCode($uid)]);
|
||||
$languages = User::getWantedLanguages($uid);
|
||||
foreach ($languages as $language) {
|
||||
$conditions[] = "JSON_EXTRACT(JSON_KEYS(language), '$[0]') = ?";
|
||||
$condition[] = $language;
|
||||
|
@ -439,7 +439,7 @@ class Timeline extends BaseModule
|
|||
|
||||
private function getMedianComments(int $uid, int $divider): int
|
||||
{
|
||||
$languages = $this->pConfig->get($uid, 'channel', 'languages', [User::getLanguageCode($uid)]);
|
||||
$languages = User::getWantedLanguages($uid);
|
||||
$cache_key = 'Channel:getMedianComments:' . $divider . ':' . implode(':', $languages);
|
||||
$comments = $this->cache->get($cache_key);
|
||||
if (!empty($comments)) {
|
||||
|
@ -463,7 +463,7 @@ class Timeline extends BaseModule
|
|||
|
||||
private function getMedianActivities(int $uid, int $divider): int
|
||||
{
|
||||
$languages = $this->pConfig->get($uid, 'channel', 'languages', [User::getLanguageCode($uid)]);
|
||||
$languages = User::getWantedLanguages($uid);
|
||||
$cache_key = 'Channel:getMedianActivities:' . $divider . ':' . implode(':', $languages);
|
||||
$activities = $this->cache->get($cache_key);
|
||||
if (!empty($activities)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue