]> git.mxchange.org Git - friendica.git/blobdiff - include/notifier.php
add doxygen to config functions
[friendica.git] / include / notifier.php
index 99a736db0a81484625a11e65ff319c0c60682f53..6c90629bd87128865e0535d80e1a0523ae1f7ce7 100644 (file)
@@ -223,13 +223,13 @@ function notifier_run(&$argv, &$argc){
 
        if(! ($mail || $fsuggest || $relocate)) {
 
-               $slap = ostatus_salmon($target_item,$owner);
+               $slap = ostatus::salmon($target_item,$owner);
 
                require_once('include/group.php');
 
                $parent = $items[0];
 
-               $thr_parent = q("SELECT `network` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
+               $thr_parent = q("SELECT `network`, `author-link`, `owner-link` FROM `item` WHERE `uri` = '%s' AND `uid` = %d",
                        dbesc($target_item["thr-parent"]), intval($target_item["uid"]));
 
                logger('Parent is '.$parent['network'].'. Thread parent is '.$thr_parent[0]['network'], LOGGER_DEBUG);
@@ -390,6 +390,20 @@ function notifier_run(&$argv, &$argc){
 
                        logger('Some parent is OStatus for '.$target_item["guid"], LOGGER_DEBUG);
 
+                       // Send a salmon to the parent author
+                       $probed_contact = probe_url($thr_parent[0]['author-link']);
+                       if ($probed_contact["notify"] != "") {
+                               logger('Notify parent author '.$probed_contact["url"].': '.$probed_contact["notify"]);
+                               $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
+                       }
+
+                       // Send a salmon to the parent owner
+                       $probed_contact = probe_url($thr_parent[0]['owner-link']);
+                       if ($probed_contact["notify"] != "") {
+                               logger('Notify parent owner '.$probed_contact["url"].': '.$probed_contact["notify"]);
+                               $url_recipients[$probed_contact["notify"]] = $probed_contact["notify"];
+                       }
+
                        // Send a salmon notification to every person we mentioned in the post
                        $arr = explode(',',$target_item['tag']);
                        foreach($arr as $x) {
@@ -536,7 +550,7 @@ function notifier_run(&$argv, &$argc){
        if($public_message) {
 
                if (!$followup)
-                       $r0 = diaspora_fetch_relay();
+                       $r0 = diaspora::relay_list();
                else
                        $r0 = array();
 
@@ -559,7 +573,7 @@ function notifier_run(&$argv, &$argc){
                $r = array_merge($r2,$r1,$r0);
 
                if(count($r)) {
-                       logger('pubdeliver: ' . print_r($r,true), LOGGER_DEBUG);
+                       logger('pubdeliver '.$target_item["guid"].': '.print_r($r,true), LOGGER_DEBUG);
 
                        // throw everything into the queue in case we get killed
 
@@ -584,7 +598,7 @@ function notifier_run(&$argv, &$argc){
                                }
 
                                if((! $mail) && (! $fsuggest) && (! $followup)) {
-                                       logger('notifier: delivery agent: ' . $rr['name'] . ' ' . $rr['id']);
+                                       logger('notifier: delivery agent: '.$rr['name'].' '.$rr['id'].' '.$rr['network'].' '.$target_item["guid"]);
                                        proc_run('php','include/delivery.php',$cmd,$item_id,$rr['id']);
                                        if($interval)
                                                @time_sleep_until(microtime(true) + (float) $interval);
@@ -628,13 +642,6 @@ function notifier_run(&$argv, &$argc){
                proc_run('php','include/pubsubpublish.php');
        }
 
-       // If the item was deleted, clean up the `sign` table
-       if($target_item['deleted']) {
-               $r = q("DELETE FROM sign where `retract_iid` = %d",
-                       intval($target_item['id'])
-               );
-       }
-
        logger('notifier: calling hooks', LOGGER_DEBUG);
 
        if($normal_mode)