]> git.mxchange.org Git - friendica.git/commitdiff
Fix forced updates on the display page
authorMichael <heluecht@pirati.ca>
Tue, 7 Jun 2022 17:34:19 +0000 (17:34 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 7 Jun 2022 17:34:19 +0000 (17:34 +0000)
mod/display.php
static/routes.config.php

index bc667dd5e122750a6c429683eda2144008f745c6..cc594d78815e0b74e77f49f56dbbfaf942f9094c 100644 (file)
@@ -160,15 +160,19 @@ function display_content(App $a, $update = false, $update_uid = 0)
                        }
                        $parent_uri_id = $item['parent-uri-id'];
                }
-               $browser_update = intval(DI::pConfig()->get($update_uid, 'system', 'update_interval'));
-               if (!empty($browser_update)) {
-                       $update_date = date(DateTimeFormat::MYSQL, time() - ($browser_update / 500));
-                       if (!Post::exists(["`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?", $parent_uri_id, 0, $update_uid, $update_date])) {
-                               Logger::debug('No updated content', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
-                               return '';
-                       } else {
-                               Logger::debug('Updated content found', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
-                       }
+               if (empty($_REQUEST['force'])) {
+                       $browser_update = intval(DI::pConfig()->get($update_uid, 'system', 'update_interval'));
+                       if (!empty($browser_update)) {
+                               $update_date = date(DateTimeFormat::MYSQL, time() - ($browser_update / 500));
+                               if (!Post::exists(["`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?", $parent_uri_id, 0, $update_uid, $update_date])) {
+                                       Logger::debug('No updated content', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
+                                       return '';
+                               } else {
+                                       Logger::debug('Updated content found', ['uri-id' => $uri_id, 'uid' => $update_uid, 'updated' => $update_date]);
+                               }
+                       }       
+               } else {
+                       Logger::debug('Forced content update', ['uri-id' => $uri_id, 'uid' => $update_uid]);
                }
        } else {
                $uri_id = ((DI::args()->getArgc() > 2) ? DI::args()->getArgv()[2] : 0);
index 4c6f5b6bb453ee0b433527f36d972b5524a75155..72964d23080ed74b2cb9da199c8e63bad45837e2 100644 (file)
@@ -233,7 +233,7 @@ return [
                        '/instance'                          => [Module\Api\Mastodon\Instance::class,                 [R::GET         ]],
                        '/instance/activity'                 => [Module\Api\Mastodon\Unimplemented::class,            [R::GET         ]], // @todo
                        '/instance/peers'                    => [Module\Api\Mastodon\Instance\Peers::class,           [R::GET         ]],
-                       '/instance/rules'                    => [Module\Api\Mastodon\Instance\Rules::class,           [R::GET         ]], // not supported
+                       '/instance/rules'                    => [Module\Api\Mastodon\Instance\Rules::class,           [R::GET         ]],
                        '/lists'                             => [Module\Api\Mastodon\Lists::class,                    [R::GET, R::POST]],
                        '/lists/{id:\d+}'                    => [Module\Api\Mastodon\Lists::class,                    [R::GET, R::PUT, R::DELETE]],
                        '/lists/{id:\d+}/accounts'           => [Module\Api\Mastodon\Lists\Accounts::class,           [R::GET, R::POST, R::DELETE]],
@@ -244,7 +244,7 @@ return [
                        '/notifications/{id:\d+}'            => [Module\Api\Mastodon\Notifications::class,            [R::GET         ]],
                        '/notifications/clear'               => [Module\Api\Mastodon\Notifications\Clear::class,      [        R::POST]],
                        '/notifications/{id:\d+}/dismiss'    => [Module\Api\Mastodon\Notifications\Dismiss::class,    [        R::POST]],
-                       '/polls/{id:\d+}'                    => [Module\Api\Mastodon\Polls::class,                    [R::GET         ]], // not supported
+                       '/polls/{id:\d+}'                    => [Module\Api\Mastodon\Polls::class,                    [R::GET         ]],
                        '/polls/{id:\d+}/votes'              => [Module\Api\Mastodon\Unimplemented::class,            [        R::POST]], // not supported
                        '/preferences'                       => [Module\Api\Mastodon\Preferences::class,              [R::GET         ]],
                        '/push/subscription'                 => [Module\Api\Mastodon\PushSubscription::class,         [R::GET, R::POST, R::PUT, R::DELETE]],