From 4a1bbd114c3188a6b3d02e95f4a12899dd93d82f Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 15 May 2018 19:29:14 +0000 Subject: [PATCH] Lower priority for "remote self" --- src/Model/Item.php | 8 +++++++- src/Protocol/Feed.php | 3 +++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 210a60109..a5ab507c2 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -344,6 +344,12 @@ class Item extends BaseObject $item['origin'] = 1; $item['network'] = NETWORK_DFRN; $item['protocol'] = PROTOCOL_DFRN; + + if (is_int($notify)) { + $priority = $notify; + } else { + $priority = PRIORITY_HIGH; + } } else { $item['network'] = trim(defaults($item, 'network', NETWORK_PHANTOM)); } @@ -872,7 +878,7 @@ class Item extends BaseObject check_user_notification($current_post); if ($notify) { - Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "Notifier", $notify_type, $current_post); + Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", $notify_type, $current_post); } elseif (!empty($parent) && $parent['origin']) { Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], "Notifier", "comment-import", $current_post); } diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 191070a2c..c04e40b5e 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -430,6 +430,9 @@ class Feed { $item['guid'] = Item::guidFromUri($orig_plink, $a->get_hostname()); unset($item['uri']); unset($item['parent-uri']); + + // Set the delivery priority for "remote self" to "medium" + $notify = PRIORITY_MEDIUM; } $id = Item::insert($item, false, $notify);