]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
Degrade priority step by step
[friendica.git] / include / notifier.php
index 28d437f4ceac73576b8e378737781e46041ea6e1..81f55f710190e3fc9a8499e374ccf81900d942b2 100644 (file)
@@ -488,7 +488,7 @@ function notifier_run(&$argv, &$argc){
                        logger("Deliver ".$target_item["guid"]." to ".$contact['url']." via network ".$contact['network'], LOGGER_DEBUG);
 
                        proc_run(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
-                                       'include/delivery.php', $cmd, $item_id, $contact['id']);
+                                       'include/delivery.php', $cmd, $item_id, (int)$contact['id']);
                }
        }
 
@@ -519,8 +519,8 @@ function notifier_run(&$argv, &$argc){
                        }
 
                        $r1 = q("SELECT `batch`, ANY_VALUE(`id`) AS `id`, ANY_VALUE(`name`) AS `name`, ANY_VALUE(`network`) AS `network`
-                               FROM `contact` WHERE `network` = '%s'
-                               AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch` ORDER BY rand()",
+                               FROM `contact` WHERE `network` = '%s' AND `batch` != ''
+                               AND `uid` = %d AND `rel` != %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` GROUP BY `batch`",
                                dbesc(NETWORK_DIASPORA),
                                intval($owner['uid']),
                                intval(CONTACT_IS_SHARING)
@@ -528,8 +528,7 @@ function notifier_run(&$argv, &$argc){
                }
 
                $r2 = q("SELECT `id`, `name`,`network` FROM `contact`
-                       WHERE `network` in ( '%s', '%s')  AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive`
-                       AND `rel` != %d order by rand() ",
+                       WHERE `network` in ('%s', '%s') AND `uid` = %d AND NOT `blocked` AND NOT `pending` AND NOT `archive` AND `rel` != %d",
                        dbesc(NETWORK_DFRN),
                        dbesc(NETWORK_MAIL2),
                        intval($owner['uid']),
@@ -554,7 +553,7 @@ function notifier_run(&$argv, &$argc){
                                if ((! $mail) && (! $fsuggest) && (! $followup)) {
                                        logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
                                        proc_run(array('priority' => $a->queue['priority'], 'created' => $a->queue['created'], 'dont_fork' => true),
-                                                       'include/delivery.php', $cmd, $item_id, $rr['id']);
+                                                       'include/delivery.php', $cmd, $item_id, (int)$rr['id']);
                                }
                        }
                }