Improvements for channel counter

This commit is contained in:
Michael 2024-03-25 07:20:41 +00:00
parent 53a2fb648f
commit 0fde21ff28
4 changed files with 46 additions and 31 deletions

View 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

View 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')
?? [];
}
}

View 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())) {

View 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 ""