the logic is much too complicated for the notifier. Let plugins know if they are going upstream or downstream with a simple binary variable.

This commit is contained in:
zotlabs 2016-10-26 02:46:14 -07:00
parent 3885aa1e8c
commit c3af36d33b

View File

@ -372,12 +372,13 @@ class Notifier {
if(! $encoded_item['flags']) if(! $encoded_item['flags'])
$encoded_item['flags'] = array(); $encoded_item['flags'] = array();
$encoded_item['flags'][] = 'relay'; $encoded_item['flags'][] = 'relay';
$upstream = true;
} }
else { else {
logger('notifier: normal distribution', LOGGER_DEBUG); logger('notifier: normal distribution', LOGGER_DEBUG);
if($cmd === 'relay') if($cmd === 'relay')
logger('notifier: owner relay'); logger('notifier: owner relay');
$upstream = false;
// if our parent is a tag_delivery recipient, uplink to the original author causing // if our parent is a tag_delivery recipient, uplink to the original author causing
// a delivery fork. // a delivery fork.
@ -446,6 +447,7 @@ class Notifier {
$narr = array( $narr = array(
'channel' => $channel, 'channel' => $channel,
'upstream' => $upstream,
'env_recips' => $env_recips, 'env_recips' => $env_recips,
'packet_recips' => $packet_recips, 'packet_recips' => $packet_recips,
'recipients' => $recipients, 'recipients' => $recipients,
@ -547,6 +549,7 @@ class Notifier {
$narr = array( $narr = array(
'channel' => $channel, 'channel' => $channel,
'upstream' => $upstream,
'env_recips' => $env_recips, 'env_recips' => $env_recips,
'packet_recips' => $packet_recips, 'packet_recips' => $packet_recips,
'recipients' => $recipients, 'recipients' => $recipients,