]> git.mxchange.org Git - friendica.git/commitdiff
Improvements for channel counter
authorMichael <heluecht@pirati.ca>
Mon, 25 Mar 2024 07:20:41 +0000 (07:20 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 27 Mar 2024 11:12:44 +0000 (11:12 +0000)
src/Content/Feature.php
src/Module/Conversation/Network.php
src/Module/Ping/Network.php
view/lang/C/messages.po

index 84a32f5ed5f16b60a966ea366d8bc49faacfbcf5..282d8928fdc2e8d985743987db33b8d16ec428ad 100644 (file)
@@ -107,7 +107,7 @@ class Feature
                                DI::l10n()->t('General Features'),
                                //array('expire',         DI::l10n()->t('Content Expiration'),          DI::l10n()->t('Remove old posts/comments after a period of time')),
                                [self::PHOTO_LOCATION, DI::l10n()->t('Photo Location'), DI::l10n()->t("Photo metadata is normally stripped. This extracts the location \x28if present\x29 prior to stripping metadata and links it to a map."), false, DI::config()->get('feature_lock', self::PHOTO_LOCATION, false)],
-                               [self::COMMUNITY, DI::l10n()->t('Display the community in the navigation'), DI::l10n()->t('If enabled, the community can be accessed via the navigation menu. Independant from this setting, the community timelines can always be accessed via the channels.'), true, DI::config()->get('feature_lock', self::COMMUNITY, false)],
+                               [self::COMMUNITY, DI::l10n()->t('Display the community in the navigation'), DI::l10n()->t('If enabled, the community can be accessed via the navigation menu. Independent from this setting, the community timelines can always be accessed via the channels.'), true, DI::config()->get('feature_lock', self::COMMUNITY, false)],
                        ],
 
                        // Post composition
index 94b1bc77f68cbc3e43c1d87a2ba8ecc2bba38df3..806f958a0d8bba6ff9dbfa352ac52e32e4637774 100644 (file)
@@ -309,7 +309,7 @@ class Network extends Timeline
                $this->circleId = (int)($this->parameters['circle_id'] ?? 0);
 
                if (!$this->selectedTab) {
-                       $this->selectedTab = self::getTimelineOrderBySession($this->session, $this->pConfig);
+                       $this->selectedTab = $this->getTimelineOrderBySession();
                } elseif (!$this->networkFactory->isTimeline($this->selectedTab) && !$this->channel->isTimeline($this->selectedTab) && !$this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId()) && !$this->community->isTimeline($this->selectedTab)) {
                        throw new HTTPException\BadRequestException($this->l10n->t('Network feed not available.'));
                }
@@ -371,6 +371,11 @@ class Network extends Timeline
                $this->dateTo = $this->parameters['to'] ?? '';
 
                $this->setMaxMinByOrder($request);
+
+               if (is_null($this->maxId) && !is_null($this->minId)) {
+                       $this->session->set('network-request', $request);
+                       $this->pConfig->set($this->session->getLocalUserId(), 'network.view', 'request', $request);
+               }
        }
 
        protected function getItems()
@@ -483,14 +488,24 @@ class Network extends Timeline
        /**
         * Returns the selected network tab of the currently logged-in user
         *
-        * @param IHandleUserSessions         $session
-        * @param IManagePersonalConfigValues $pconfig
         * @return string
         */
-       public static function getTimelineOrderBySession(IHandleUserSessions $session, IManagePersonalConfigValues $pconfig): string
+       private function getTimelineOrderBySession(): string
        {
-               return $session->get('network-tab')
-                       ?? $pconfig->get($session->getLocalUserId(), 'network.view', 'selected_tab')
+               return $this->session->get('network-tab')
+                       ?? $this->pConfig->get($this->session->getLocalUserId(), 'network.view', 'selected_tab')
                        ?? '';
        }
+
+       /**
+        * Returns the lst request parameters of the currently logged-in user
+        *
+        * @return array
+        */
+       protected function getTimelineRequestBySession(): array
+       {
+               return $this->session->get('network-request')
+                       ?? $this->pConfig->get($this->session->getLocalUserId(), 'network.view', 'request')
+                       ?? [];
+       }
 }
index 09ae7b2b446fd38ad0afd78defb546125493a698..9eec3b366ab69adb19022f80d8e440c1777c559b 100644 (file)
@@ -28,8 +28,12 @@ class Network extends NetworkModule
 {
        protected function rawContent(array $request = [])
        {
+               if (!$this->session->getLocalUserId()) {
+                       System::exit();
+               }
+
                if (!empty($request['ping'])) {
-                       $request = $this->session->get('network-request');
+                       $request = $this->getTimelineRequestBySession();
                }
 
                if (!isset($request['p']) || !isset($request['item'])) {
@@ -42,10 +46,6 @@ class Network extends NetworkModule
                        System::httpExit('');
                }
 
-               if (empty($request['ping'])) {
-                       $this->session->set('network-request', $request);
-               }
-
                $this->itemsPerPage = 100;
 
                if ($this->channel->isTimeline($this->selectedTab) || $this->userDefinedChannel->isTimeline($this->selectedTab, $this->session->getLocalUserId())) {
index e61bfe50f584f97c47776ef59852263c304e1427..c2817a619906a12d23c075cc9d5c1d6b5c8bf56a 100644 (file)
@@ -8,7 +8,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: 2024.06-dev\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2024-03-26 18:34+0100\n"
+"POT-Creation-Date: 2024-03-27 11:11+0000\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2791,8 +2791,8 @@ msgstr ""
 
 #: src/Core/Installer.php:516
 msgid ""
-"The web installer needs to be able to create a file called \"local.config."
-"php\" in the \"config\" folder of your web server and it is unable to do so."
+"The web installer needs to be able to create a file called \"local.config.php"
+"\" in the \"config\" folder of your web server and it is unable to do so."
 msgstr ""
 
 #: src/Core/Installer.php:517
@@ -3952,8 +3952,8 @@ msgid ""
 "profile\n"
 "\t\t\t(on the \"Profiles\" page) so that other people can easily find you.\n"
 "\n"
-"\t\t\tWe recommend adding a profile photo, adding some profile "
-"\"keywords\" (very useful\n"
+"\t\t\tWe recommend adding a profile photo, adding some profile \"keywords"
+"\" (very useful\n"
 "\t\t\tin making new friends) - and perhaps what country you live in; if you "
 "do not wish\n"
 "\t\t\tto be more specific than that.\n"
@@ -5723,9 +5723,9 @@ msgstr ""
 
 #: src/Module/Admin/Summary.php:98
 msgid ""
-"The last update failed. Please run \"php bin/console.php dbstructure "
-"update\" from the command line and have a look at the errors that might "
-"appear. (Some of the errors are possibly inside the logfile.)"
+"The last update failed. Please run \"php bin/console.php dbstructure update"
+"\" from the command line and have a look at the errors that might appear. "
+"(Some of the errors are possibly inside the logfile.)"
 msgstr ""
 
 #: src/Module/Admin/Summary.php:102
@@ -5876,8 +5876,8 @@ msgstr ""
 #, php-format
 msgid ""
 "Show some informations regarding the needed information to operate the node "
-"according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener "
-"noreferrer\">EU-GDPR</a>."
+"according e.g. to <a href=\"%s\" target=\"_blank\" rel=\"noopener noreferrer"
+"\">EU-GDPR</a>."
 msgstr ""
 
 #: src/Module/Admin/Tos.php:81
@@ -9182,8 +9182,8 @@ msgstr ""
 #: src/Module/Profile/Profile.php:158
 #, php-format
 msgid ""
-"You're currently viewing your profile as <b>%s</b> <a href=\"%s\" "
-"class=\"btn btn-sm pull-right\">Cancel</a>"
+"You're currently viewing your profile as <b>%s</b> <a href=\"%s\" class="
+"\"btn btn-sm pull-right\">Cancel</a>"
 msgstr ""
 
 #: src/Module/Profile/Profile.php:167
@@ -9703,8 +9703,8 @@ msgstr ""
 #: src/Module/Security/TwoFactor/Verify.php:100
 #, php-format
 msgid ""
-"If you do not have access to your authentication code you can use a <a "
-"href=\"%s\">two-factor recovery code</a>."
+"If you do not have access to your authentication code you can use a <a href="
+"\"%s\">two-factor recovery code</a>."
 msgstr ""
 
 #: src/Module/Security/TwoFactor/Verify.php:101
@@ -11412,8 +11412,8 @@ msgstr ""
 #: src/Module/Settings/TwoFactor/Verify.php:152
 #, php-format
 msgid ""
-"<p>Or you can open the following URL in your mobile device:</p><p><a "
-"href=\"%s\">%s</a></p>"
+"<p>Or you can open the following URL in your mobile device:</p><p><a href="
+"\"%s\">%s</a></p>"
 msgstr ""
 
 #: src/Module/Settings/TwoFactor/Verify.php:159
@@ -11522,9 +11522,9 @@ msgstr ""
 msgid ""
 "At any point in time a logged in user can export their account data from the "
 "<a href=\"%1$s/settings/userexport\">account settings</a>. If the user wants "
-"to delete their account they can do so at <a href=\"%1$s/settings/"
-"removeme\">%1$s/settings/removeme</a>. The deletion of the account will be "
-"permanent. Deletion of the data will also be requested from the nodes of the "
+"to delete their account they can do so at <a href=\"%1$s/settings/removeme\">"
+"%1$s/settings/removeme</a>. The deletion of the account will be permanent. "
+"Deletion of the data will also be requested from the nodes of the "
 "communication partners."
 msgstr ""