aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-09-05 09:09:34 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-09-05 09:09:34 +0200
commit0283cbfcd35a29b5689ffbf16439d448de0c7254 (patch)
tree9fa9aa4b7fb3454ab60d63ad584aafaf20850999 /include/notifier.php
parent058e329dfbc2678fa7e3cb2ce130fb9ffd69b84d (diff)
parent7e8100d2cd27227435ba6ff421dd3c3d8689930f (diff)
downloadvolse-hubzilla-0283cbfcd35a29b5689ffbf16439d448de0c7254.tar.gz
volse-hubzilla-0283cbfcd35a29b5689ffbf16439d448de0c7254.tar.bz2
volse-hubzilla-0283cbfcd35a29b5689ffbf16439d448de0c7254.zip
Merge remote-tracking branch 'friendika/master' into newui
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 8d2aa961c..6ac882c19 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;
}