X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnotifier.php;h=2562f09eb05bb53f64187268a54d3ba1c72afe86;hb=adcaefce89c23ebb518f3454be15379a9d57e560;hp=61274bedf04b1935788dff6876cca93a7d94c974;hpb=ea9d3b06f6dbe2d7bf036ea1785a1e472f6bf890;p=friendica.git diff --git a/include/notifier.php b/include/notifier.php index 61274bedf0..2562f09eb0 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -206,7 +206,7 @@ function notifier_run($argv, $argc){ /** * - * Be VERY CAREFUL if you make any changes to the following lines. Seemingly innocuous changes + * Be VERY CAREFUL if you make any changes to the following several lines. Seemingly innocuous changes * have been known to cause runaway conditions which affected several servers, along with * permissions issues. * @@ -219,6 +219,22 @@ function notifier_run($argv, $argc){ } + if(($cmd === 'uplink') && (intval($parent['forum_mode'])) && (! $top_level)) { + $relay_to_owner = true; + } + + // until the 'origin' flag has been in use for several months + // we will just use it as a fallback test + // later we will be able to use it as the primary test of whether or not to relay. + + if(! $target_item['origin']) + $relay_to_owner = false; + + if($parent['origin']) + $relay_to_owner = false; + + + if($relay_to_owner) { logger('notifier: followup', LOGGER_DEBUG); // local followup to remote post @@ -248,6 +264,13 @@ function notifier_run($argv, $argc){ $deny_people = expand_acl($parent['deny_cid']); $deny_groups = expand_groups(expand_acl($parent['deny_gid'])); + // if our parent is a forum, uplink to the origonal author causing + // a delivery fork + + if(intval($parent['forum_mode']) && (! $top_level) && ($cmd !== 'uplink')) { + proc_run('php','include/notifier','uplink',$item_id); + } + $conversants = array(); foreach($items as $item) { @@ -300,7 +323,7 @@ function notifier_run($argv, $argc){ $birthday = '' . xmlify($birthday) . ''; $atom .= replace_macros($feed_template, array( - '$version' => xmlify(FRIENDIKA_VERSION), + '$version' => xmlify(FRIENDICA_VERSION), '$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner['nickname'] ), '$feed_title' => xmlify($owner['name']), '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) , @@ -640,7 +663,15 @@ function notifier_run($argv, $argc){ case NETWORK_DIASPORA: require_once('include/diaspora.php'); - if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled')) || (! $normal_mode)) + if(get_config('system','dfrn_only') || (! get_config('system','diaspora_enabled'))) + break; + + if($mail) { + diaspora_send_mail($item,$owner,$contact); + break; + } + + if(! $normal_mode) break; // special handling for followup to public post @@ -710,7 +741,7 @@ function notifier_run($argv, $argc){ if($public_message) { $r1 = q("SELECT DISTINCT(`batch`), `id`, `name`,`network` FROM `contact` WHERE `network` = '%s' - AND `uid` = %d AND `rel` != %d ORDER BY rand() ", + AND `uid` = %d AND `rel` != %d group by `batch` ORDER BY rand() ", dbesc(NETWORK_DIASPORA), intval($owner['uid']), intval(CONTACT_IS_SHARING)