mirror of
https://github.com/friendica/friendica
synced 2025-04-21 18: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)) {
|
||||
|
|
|
@ -265,7 +265,7 @@ class Display extends BaseSettings
|
|||
|
||||
$bookmarked_timelines = $this->pConfig->get($uid, 'system', 'network_timelines', $this->getAvailableTimelines($uid, true)->column('code'));
|
||||
$enabled_timelines = $this->pConfig->get($uid, 'system', 'enabled_timelines', $this->getAvailableTimelines($uid, false)->column('code'));
|
||||
$channel_languages = $this->pConfig->get($uid, 'channel', 'languages', [User::getLanguageCode($uid)]);
|
||||
$channel_languages = User::getWantedLanguages($uid);
|
||||
$languages = $this->l10n->getLanguageCodes(true);
|
||||
|
||||
$timelines = [];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue