From 8e240385ab485195c4a5b06fa9e4795651081fa1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 7 Jan 2024 07:40:51 +0100 Subject: [PATCH] Continued: - restored (maybe due to bad rebasing) - replaced double-quotes with single --- src/Content/Nav.php | 6 ++---- src/Module/Conversation/Channel.php | 9 +++++---- src/Protocol/Feed.php | 2 +- src/Worker/Cron.php | 2 +- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Content/Nav.php b/src/Content/Nav.php index fa8366ed0c..a8f568630f 100644 --- a/src/Content/Nav.php +++ b/src/Content/Nav.php @@ -284,14 +284,12 @@ class Nav $gdirpath = Profile::zrl($this->config->get('system', 'directory'), true); } - if ((!$this->session->isAuthenticated() && $this->config->get('system', 'community_page_style') != Community::DISABLED_VISITOR) && - !($this->config->get('system', 'community_page_style') == Community::DISABLED) - ) { + if (($this->session->getLocalUserId() || $this->config->get('system', 'community_page_style') != Community::DISABLED_VISITOR) && + !($this->config->get('system', 'community_page_style') == Community::DISABLED)) { $nav['community'] = ['community', $this->l10n->t('Community'), '', $this->l10n->t('Conversations on this and other servers')]; } if ($this->session->getLocalUserId()) { - $nav['channel'] = ['channel', $this->l10n->t('Channels'), '', $this->l10n->t('Current posts, filtered by several rules')]; $nav['calendar'] = ['calendar', $this->l10n->t('Calendar'), '', $this->l10n->t('Calendar')]; } diff --git a/src/Module/Conversation/Channel.php b/src/Module/Conversation/Channel.php index 893598f55b..dae6544c01 100644 --- a/src/Module/Conversation/Channel.php +++ b/src/Module/Conversation/Channel.php @@ -92,7 +92,7 @@ class Channel extends Timeline $this->parseRequest($request); - $t = Renderer::getMarkupTemplate("community.tpl"); + $t = Renderer::getMarkupTemplate('community.tpl'); $o = Renderer::replaceMacros($t, [ '$content' => '', '$header' => '', @@ -103,9 +103,10 @@ class Channel extends Timeline $o .= Renderer::replaceMacros($tpl, ['$reload_uri' => $this->args->getQueryString()]); } - if (empty($request['mode']) || ($request['mode'] != 'raw')) { - $tabs = $this->getTabArray($this->timeline->getChannelsForUser($this->session->getLocalUserId()), 'channel'); - $tabs = array_merge($tabs, $this->getTabArray($this->timeline->getCommunities(true), 'channel')); + if (!$this->raw) { + $tabs = $this->getTabArray($this->channel->getTimelines($this->session->getLocalUserId()), 'channel'); + $tabs = array_merge($tabs, $this->getTabArray($this->channelRepository->selectByUid($this->session->getLocalUserId()), 'channel')); + $tabs = array_merge($tabs, $this->getTabArray($this->community->getTimelines(true), 'channel')); $tab_tpl = Renderer::getMarkupTemplate('common_tabs.tpl'); $o .= Renderer::replaceMacros($tab_tpl, ['$tabs' => $tabs]); diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 4438c31fde..5e0662f65a 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -638,7 +638,7 @@ class Feed // We always strip the title since it will be added in the page information $item['title'] = ''; $item['body'] = $item['body'] . "\n" . PageInfo::getFooterFromData($data, false); - $taglist = $contact['fetch_further_information'] == 2 ? PageInfo::getTagsFromUrl($item['plink'], $preview, $contact['ffi_keyword_blacklist'] ?? '') : []; + $taglist = $fetch_further_information == LocalRelationship::FFI_BOTH ? PageInfo::getTagsFromUrl($item['plink'], $preview, $contact['ffi_keyword_denylist'] ?? '') : []; $item['object-type'] = Activity\ObjectType::BOOKMARK; $attachments = []; diff --git a/src/Worker/Cron.php b/src/Worker/Cron.php index 40cc5e7a44..06e59ec97c 100644 --- a/src/Worker/Cron.php +++ b/src/Worker/Cron.php @@ -147,7 +147,7 @@ class Cron DBA::close($users); // Update contact relations for our users - $users = DBA::select('user', ['uid'], ["NOT `account_expired` AND NOT `account_removed` AND `uid` > ?", 0]); + $users = DBA::select('user', ['uid'], ["`verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired` AND `uid` > ?", 0]); while ($user = DBA::fetch($users)) { Worker::add(Worker::PRIORITY_LOW, 'ContactDiscoveryForUser', $user['uid']); } -- 2.39.5