aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-01-13 18:35:12 -0800
committerfriendica <info@friendica.com>2013-01-13 18:35:12 -0800
commit5182d6d820ee67404a84114f5c4074c3ae55bf84 (patch)
tree49ad2dc9ccbfab03f9f6197aa8ee6681b7cc9ff1 /include/notifier.php
parent83ca9dfc2396cdb3134bc8f7b6a02c80f7c5b537 (diff)
downloadvolse-hubzilla-5182d6d820ee67404a84114f5c4074c3ae55bf84.tar.gz
volse-hubzilla-5182d6d820ee67404a84114f5c4074c3ae55bf84.tar.bz2
volse-hubzilla-5182d6d820ee67404a84114f5c4074c3ae55bf84.zip
this should make tag delivery (e.g. forums) work - but not yet fully tested
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php21
1 files changed, 18 insertions, 3 deletions
diff --git a/include/notifier.php b/include/notifier.php
index feb1c693c..74da8f2f8 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -234,19 +234,25 @@ function notifier_run($argv, $argc){
$encoded_item = encode_item($target_item);
-
$relay_to_owner = (((! $top_level_post) && ($target_item['item_flags'] & ITEM_ORIGIN)) ? true : false);
+ $uplink = false;
+
// $cmd === 'relay' indicates the owner is sending it to the original recipients
// don't allow the item in the relay command to relay to owner under any circumstances, it will loop
logger('notifier: relay_to_owner: ' . (($relay_to_owner) ? 'true' : 'false'));
logger('notifier: top_level_post: ' . (($top_level_post) ? 'true' : 'false'));
logger('notifier: target_item_flags: ' . $target_item['item_flags'] . ' ' . (($target_item['item_flags'] & ITEM_ORIGIN ) ? 'true' : 'false'));
+ // tag_deliver'd post which needs to be sent back to the original author
- if(($relay_to_owner) && ($cmd !== 'relay')) {
+ if(($cmd === 'uplink') && ($parent_item['item_flags'] & ITEM_UPLINK) && (! $top_level_post)) {
+ $uplink = true;
+ }
+
+ if(($relay_to_owner || $uplink) && ($cmd !== 'relay')) {
logger('notifier: followup relay', LOGGER_DEBUG);
- $recipients = array($parent_item['owner_xchan']);
+ $recipients = array(($uplink) ? $parent_item['author_xchan'] : $parent_item['owner_xchan']);
$private = true;
if(! $encoded_item['flags'])
$encoded_item['flags'] = array();
@@ -256,6 +262,15 @@ function notifier_run($argv, $argc){
logger('notifier: normal distribution', LOGGER_DEBUG);
if($cmd === 'relay')
logger('notifier: owner relay');
+
+ // if our parent is a tag_delivery recipient, uplink to the original author causing
+ // a delivery fork.
+
+ if(($parent_item['item_flags'] & ITEM_UPLINK) && (! $top_level_post) && ($cmd !== 'uplink')) {
+ logger('notifier: uplinking this item');
+ proc_run('php','include/notifier.php','uplink',$item_id);
+ }
+
$private = false;
$recipients = collect_recipients($parent_item,$private);