]> git.mxchange.org Git - friendica.git/commitdiff
Further improvements to the automatic update process
authorMichael <heluecht@pirati.ca>
Sun, 17 Sep 2023 08:17:31 +0000 (08:17 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 17 Sep 2023 08:17:31 +0000 (08:17 +0000)
src/Module/Conversation/Network.php
src/Module/Conversation/Timeline.php
src/Module/Update/Channel.php
src/Module/Update/Community.php
src/Module/Update/Network.php

index 63da5717ad111cdeb0936d2a5635b3dfb2d88944..1d6dc86c3550e73738e42fd03fc5b4a725b1e299 100644 (file)
@@ -348,9 +348,9 @@ class Network extends Timeline
                        $this->order = 'commented';
                }
 
-               // Upon force (updates in the background) and order by last comment we order by receive date,
+               // Upon updates in the background and order by last comment we order by receive date,
                // since otherwise the feed will optically jump, when some already visible thread has been updated.
-               if ($this->force && ($this->selectedTab == TimelineEntity::COMMENTED) && !empty($request['first_commented'])) {
+               if ($this->update && ($this->selectedTab == TimelineEntity::COMMENTED)) {
                        $this->order = 'received';
                }
 
index ac67be95741896e5cbe3ceff6611740c5ac0355b..d685013ba4abb67e8a673b02e843cbe6ddc95eb6 100644 (file)
@@ -64,6 +64,8 @@ class Timeline extends BaseModule
        protected $noSharer;
        /** @var bool */
        protected $force;
+       /** @var bool */
+       protected $update;
 
        /** @var App\Mode $mode */
        protected $mode;
@@ -131,7 +133,8 @@ class Timeline extends BaseModule
                $this->maxId = $request['max_id'] ?? null;
 
                $this->noSharer = !empty($request['no_sharer']);
-               $this->force    = !empty($request['force']);
+               $this->force    = !empty($request['force']) && !empty($request['item']);
+               $this->update   = !empty($request['force']) && !empty($request['first_received']) && !empty($request['first_created']) && !empty($request['first_uriid']) && !empty($request['first_commented']);
        }
 
        protected function getNoSharerWidget(string $base): string
index 223666739b54a8d442f609d849a160b878e965f3..ac35d9c26bd6a82b2779119ec23b2e0df56d9588 100644 (file)
@@ -37,7 +37,7 @@ class Channel extends ChannelModule
                $this->parseRequest($request);
 
                $o = '';
-               if ($this->force) {
+               if ($this->update || $this->force) {
                        if ($this->timeline->isChannel($this->selectedTab)) {
                                $items = $this->getChannelItems();
                        } else {
index 31f75d24e2e35eff171915114c25d3ec91315bfb..05ea8f828c8292e7d10785dd982cb345116f40e0 100644 (file)
@@ -39,7 +39,7 @@ class Community extends CommunityModule
                $this->parseRequest($request);
 
                $o = '';
-               if ($this->force) {
+               if ($this->update || $this->force) {
                        $o = DI::conversation()->render($this->getCommunityItems(), Conversation::MODE_COMMUNITY, true, false, 'commented', DI::userSession()->getLocalUserId());
                }
 
index 5f7f234e046506b670e488a030e4b5e74a45848b..e8a2dce07da614564e305f3c05b8c2bf11e229a4 100644 (file)
@@ -37,7 +37,7 @@ class Network extends NetworkModule
 
                $o = '';
 
-               if (!$this->force) {
+               if (!$this->update && !$this->force) {
                        System::htmlUpdateExit($o);
                }