From b54465ba9c3c3fcea52f2d2907496c056dc0e152 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 2 Dec 2020 05:08:39 +0000 Subject: [PATCH] Directly post non mirrored feed items --- src/Protocol/Feed.php | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 1cecee1e23..dbfb72977d 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -638,24 +638,27 @@ class Feed $post_delay = 0; foreach ($postings as $posting) { - $publish_time = time(); + if (!$posting['notify']) { + Post\Delayed::publish($posting['item'], $posting['notify'], $posting['taglist'], $posting['attachments']); + continue; + } - 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; - } + 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(); + } - $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; - } + $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);