]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
first work for consensus
[friendica.git] / include / notifier.php
index 84ed9884aaa85d2eb0ae2bab18f6adbdfc2083f8..d4d254f1c9a82a628aad02b43bef658a189b4c17 100644 (file)
@@ -295,7 +295,7 @@ function notifier_run(&$argv, &$argc){
                        $relay_to_owner = false;
 
                if($relay_to_owner) {
-                       logger('notifier: followup', LOGGER_DEBUG);
+                       logger('notifier: followup '.$target_item["guid"], LOGGER_DEBUG);
                        // local followup to remote post
                        $followup = true;
                        $public_message = false; // not public
@@ -331,6 +331,8 @@ function notifier_run(&$argv, &$argc){
                } else {
                        $followup = false;
 
+                       logger('Distributing directly '.$target_item["guid"], LOGGER_DEBUG);
+
                        // don't send deletions onward for other people's stuff
 
                        if($target_item['deleted'] && (! intval($target_item['wall']))) {
@@ -378,7 +380,7 @@ function notifier_run(&$argv, &$argc){
                        }
 
                        if (count($url_recipients))
-                               logger('notifier: url_recipients ' . print_r($url_recipients,true));
+                               logger('notifier: '.$target_item["guid"].' url_recipients ' . print_r($url_recipients,true));
 
                        $conversants = array_unique($conversants);
 
@@ -394,6 +396,8 @@ function notifier_run(&$argv, &$argc){
                // We have not only to look at the parent, since it could be a Friendica thread.
                if (($thr_parent AND ($thr_parent[0]['network'] == NETWORK_OSTATUS)) OR ($parent['network'] == NETWORK_OSTATUS)) {
 
+                       logger('Some parent is OStatus for '.$target_item["guid"], LOGGER_DEBUG);
+
                        // Send a salmon notification to every person we mentioned in the post
                        $arr = explode(',',$target_item['tag']);
                        foreach($arr as $x) {
@@ -611,6 +615,10 @@ function notifier_run(&$argv, &$argc){
 
        $interval = ((get_config('system','delivery_interval') === false) ? 2 : intval(get_config('system','delivery_interval')));
 
+       // If we are using the worker we don't need a delivery interval
+       if (get_config("system", "worker"))
+               $interval = false;
+
        // delivery loop
 
        if(count($r)) {
@@ -630,7 +638,7 @@ function notifier_run(&$argv, &$argc){
 
                // This controls the number of deliveries to execute with each separate delivery process.
                // By default we'll perform one delivery per process. Assuming a hostile shared hosting
-               // provider, this provides the greatest chance of deliveries if processes start getting 
+               // provider, this provides the greatest chance of deliveries if processes start getting
                // killed. We can also space them out with the delivery_interval to also help avoid them
                // getting whacked.
 
@@ -638,8 +646,10 @@ function notifier_run(&$argv, &$argc){
                // together into a single process. This will reduce the overall number of processes
                // spawned for each delivery, but they will run longer.
 
+               // When using the workerqueue, we don't need this functionality.
+
                $deliveries_per_process = intval(get_config('system','delivery_batch_count'));
-               if($deliveries_per_process <= 0)
+               if (($deliveries_per_process <= 0) OR get_config("system", "worker"))
                        $deliveries_per_process = 1;
 
                $this_batch = array();
@@ -650,7 +660,7 @@ function notifier_run(&$argv, &$argc){
                        if($contact['self'])
                                continue;
 
-                       logger("Deliver to ".$contact['url'], LOGGER_DEBUG);
+                       logger("Deliver ".$target_item["guid"]." to ".$contact['url'], LOGGER_DEBUG);
 
                        // potentially more than one recipient. Start a new process and space them out a bit.
                        // we will deliver single recipient types of message and email recipients here.