]> git.mxchange.org Git - friendica.git/commitdiff
Only delay mirrored feeds
authorMichael <heluecht@pirati.ca>
Wed, 2 Dec 2020 04:53:54 +0000 (04:53 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 2 Dec 2020 04:53:54 +0000 (04:53 +0000)
src/Protocol/Feed.php

index ed24defc2e3fe20e55f412685b14b0f60152a60d..1cecee1e2310a0e50704c1cc95807e211ffe2ed5 100644 (file)
@@ -638,22 +638,24 @@ class Feed
                        $post_delay = 0;
 
                        foreach ($postings as $posting) {
-                               if ($delay > 0) {
-                                       $publish_time = time() + $post_delay;
-                                       Logger::notice('Got publishing date', ['delay' => $delay, 'cid' => $contact['id'], 'url' => $contact['url']]);
-                                       $post_delay += $delay;
-                               } else {
-                                       $publish_time = time();
-                               }
+                               $publish_time = time();
 
-                               $last_publish = DI::pConfig()->get($posting['item']['uid'], 'system', 'last_publish', 0, true);
-                               $next_publish = max($last_publish + (60 * $min_posting), time());
-                               if ($publish_time < $next_publish) {
-                                       Logger::notice('Adapting publish time',
-                                               ['last' => date(DateTimeFormat::MYSQL, $last_publish),
-                                               'next' => date(DateTimeFormat::MYSQL, $next_publish),
-                                               'publish' => date(DateTimeFormat::MYSQL, $publish_time)]);
-                                       $publish_time = $next_publish;
+                               if ($posting['notify']) {
+                                       if ($delay > 0) {
+                                               $publish_time = time() + $post_delay;
+                                               Logger::notice('Got publishing date', ['delay' => $delay, 'cid' => $contact['id'], 'url' => $contact['url']]);
+                                               $post_delay += $delay;
+                                       }
+
+                                       $last_publish = DI::pConfig()->get($posting['item']['uid'], 'system', 'last_publish', 0, true);
+                                       $next_publish = max($last_publish + (60 * $min_posting), time());
+                                       if ($publish_time < $next_publish) {
+                                               Logger::notice('Adapting publish time',
+                                                       ['last' => date(DateTimeFormat::MYSQL, $last_publish),
+                                                       'next' => date(DateTimeFormat::MYSQL, $next_publish),
+                                                       'publish' => date(DateTimeFormat::MYSQL, $publish_time)]);
+                                               $publish_time = $next_publish;
+                                       }
                                }
                                $publish_at = date(DateTimeFormat::MYSQL, $publish_time);