aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-17 18:16:46 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-17 18:16:46 -0800
commit1b9722c65ac2169cadcf78376aaaf9d82721c9cd (patch)
tree63f02227d902842be89dc29387f01c8fbf2769df /include
parent62a60e554235c66c88955d16134c874ad560bf72 (diff)
downloadvolse-hubzilla-1b9722c65ac2169cadcf78376aaaf9d82721c9cd.tar.gz
volse-hubzilla-1b9722c65ac2169cadcf78376aaaf9d82721c9cd.tar.bz2
volse-hubzilla-1b9722c65ac2169cadcf78376aaaf9d82721c9cd.zip
loop detection
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php8
-rw-r--r--include/notifier.php9
2 files changed, 12 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index 7343f7165..44f9633a9 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3335,7 +3335,6 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
if((! $private) && $new_public_policy)
$private = 1;
-
$item_wall = 1;
$item_origin = 1;
$item_uplink = 0;
@@ -3386,8 +3385,13 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
if($r)
proc_run('php','include/notifier.php','tgroup',$item_id);
- else
+ else {
logger('start_delivery_chain: failed to update item');
+ // reset the source xchan to prevent loops
+ $r = q("update item set source_xchan = '' where id = %d",
+ intval($item_id)
+ );
+ }
}
/**
diff --git a/include/notifier.php b/include/notifier.php
index 67e2472ef..50981df9d 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -378,9 +378,12 @@ function notifier_run($argv, $argc){
// if our parent is a tag_delivery recipient, uplink to the original author causing
// a delivery fork.
- if(intval($parent_item['item_uplink']) && (! $top_level_post) && ($cmd !== 'uplink')) {
- logger('notifier: uplinking this item');
- proc_run('php','include/notifier.php','uplink',$item_id);
+ if(($parent_item) && intval($parent_item['item_uplink']) && (! $top_level_post) && ($cmd !== 'uplink')) {
+ // don't uplink a relayed post to the relay owner
+ if($parent_item['source_xchan'] !== $parent_item['owner_xchan']) {
+ logger('notifier: uplinking this item');
+ proc_run('php','include/notifier.php','uplink',$item_id);
+ }
}
$private = false;