]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Update/Display.php
Merge remote-tracking branch 'upstream/develop' into user-defined-channels
[friendica.git] / src / Module / Update / Display.php
index 11e3a3eda74af04c5b1d7cb7181fccd8ded055ab..57f5679790d05d2cb19311aac6a39a0aacdb6602 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2023, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -17,7 +17,6 @@
  * You should have received a copy of the GNU Affero General Public License
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  *
- * See update_profile.php for documentation
  */
 
 namespace Friendica\Module\Update;
@@ -49,7 +48,7 @@ class Display extends DisplayModule
                $item = Post::selectFirst(
                        ['uid', 'parent-uri-id', 'uri-id'],
                        ['uri-id' => $uriId, 'uid' => [0, $profileUid]],
-                       ['order' => ['uid' => true]]
+                       ['order'  => ['uid' => true]]
                );
 
                if (empty($item)) {
@@ -60,9 +59,9 @@ class Display extends DisplayModule
                $parentUriId = $item['parent-uri-id'];
 
                if (empty($force)) {
-                       $browserUpdate = $this->pConfig->get($profileUid, 'system', 'update_interval');
-                       if (!empty($browserUpdate)) {
-                               $updateDate = date(DateTimeFormat::MYSQL, time() - (intval($browserUpdate) / 500));
+                       $browserUpdate = intval($this->pConfig->get($profileUid, 'system', 'update_interval') ?? 40000);
+                       if ($browserUpdate >= 1000) {
+                               $updateDate = date(DateTimeFormat::MYSQL, time() - ($browserUpdate * 2 / 1000));
                                if (!Post::exists([
                                        "`parent-uri-id` = ? AND `uid` IN (?, ?) AND `received` > ?",
                                        $parentUriId, 0,