X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnotifier.php;h=6ac882c1992cf96511901f3c6f54033444aaffc2;hb=d284f8017cefb79571fe51c4ae3f85b9b4e517c9;hp=8d2aa961cf2fb41330a26fc2b392bde53be68fb4;hpb=d49895a8a10442e1a585732e94230ac51e92396d;p=friendica.git diff --git a/include/notifier.php b/include/notifier.php index 8d2aa961cf..6ac882c199 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -2,6 +2,20 @@ require_once("boot.php"); +/* + * This file was at one time responsible for doing all deliveries, but this caused + * big problems on shared hosting systems, where the process might get killed by the + * hosting provider and nothing would get delivered. + * It now only delivers one message under certain cases, and invokes a queued + * delivery mechanism (include/deliver.php) to deliver individual contacts at + * controlled intervals. + * This has a much better chance of surviving random processes getting killed + * by the hosting provider. + * A lot of this code is duplicated in include/deliver.php until we have time to go back + * and re-structure the delivery procedure based on the obstacles that have been thrown at + * us by hosting providers. + */ + function notifier_run($argv, $argc){ global $a, $db; @@ -129,6 +143,7 @@ function notifier_run($argv, $argc){ logger('notifier: top level post'); $top_level = true; } + } $r = q("SELECT `contact`.*, `user`.`pubkey` AS `upubkey`, `user`.`prvkey` AS `uprvkey`, @@ -144,6 +159,8 @@ function notifier_run($argv, $argc){ $owner = $r[0]; + $walltowall = ((($top_level) && ($owner['id'] != $items[0]['contact-id'])) ? true : false); + $hub = get_config('system','huburl'); // If this is a public conversation, notify the feed hub @@ -591,7 +608,8 @@ function notifier_run($argv, $argc){ diaspora_send_relay($target_item,$owner,$contact); break; } - elseif($top_level) { + elseif(($top_level) && (! $walltowall)) { + // currently no workable solution for sending walltowall diaspora_send_status($target_item,$owner,$contact); break; }