X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fnotifier.php;h=ead7aebad484e0478e79002cc635867f2557ae3d;hb=64d0616762efcff413a335f2fdde4d8219d44895;hp=a4fe9b71e083c33ac0ab64bfb77a8db15d2a5bd8;hpb=327105a4ea722e746cae0caa2731ec13435fadc7;p=friendica.git diff --git a/include/notifier.php b/include/notifier.php old mode 100644 new mode 100755 index a4fe9b71e0..ead7aebad4 --- a/include/notifier.php +++ b/include/notifier.php @@ -111,7 +111,7 @@ function notifier_run($argv, $argc){ else { // find ancestors - $r = q("SELECT * FROM `item` WHERE `id` = %d LIMIT 1", + $r = q("SELECT * FROM `item` WHERE `id` = %d and visible = 1 and moderated = 0 LIMIT 1", intval($item_id) ); @@ -128,7 +128,7 @@ function notifier_run($argv, $argc){ return; $items = q("SELECT `item`.*, `sign`.`signed_text`,`sign`.`signature`,`sign`.`signer` - FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d ORDER BY `id` ASC", + FROM `item` LEFT JOIN `sign` ON `sign`.`iid` = `item`.`id` WHERE `parent` = %d and visible = 1 and moderated = 0 ORDER BY `id` ASC", intval($parent_id) ); @@ -218,6 +218,11 @@ function notifier_run($argv, $argc){ $relay_to_owner = true; } + + 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. @@ -259,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) { @@ -311,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)) , @@ -614,7 +626,13 @@ function notifier_run($argv, $argc){ $reply_to = $r1[0]['reply_to']; $subject = (($it['title']) ? $it['title'] : t("\x28no subject\x29")) ; - $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n"; + + // only expose our real email address to true friends + + if($contact['rel'] == CONTACT_IS_FRIEND) + $headers = 'From: ' . $local_user[0]['username'] . ' <' . $local_user[0]['email'] . '>' . "\n"; + else + $headers = 'From: ' . $local_user[0]['username'] . ' <' . t('noreply') . '@' . $a->get_hostname() . '>' . "\n"; if($reply_to) $headers .= 'Reply-to: ' . $reply_to . "\n"; @@ -651,7 +669,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