aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-02-25 15:27:33 -0800
committerfriendica <info@friendica.com>2015-02-25 15:27:33 -0800
commitb32841e2ddc53758957ca3afccb3e045fdf2e9fe (patch)
treef9d7a47b8f7f7b3b3382f6e99950e9ab19c0183d /include/notifier.php
parent1a071ea4f07d4e3a1dd4199f6523d61f8bbc69b8 (diff)
downloadvolse-hubzilla-b32841e2ddc53758957ca3afccb3e045fdf2e9fe.tar.gz
volse-hubzilla-b32841e2ddc53758957ca3afccb3e045fdf2e9fe.tar.bz2
volse-hubzilla-b32841e2ddc53758957ca3afccb3e045fdf2e9fe.zip
Found the cause of the delete looping, and I can prevent it going forward. The issue remains what to do about comments which are already in the DB and have ITEM_ORIGIN incorrectly set. We can't exactly reset them because the "original" context has been lost. (Sorry but couldn't resist an insider pun that none of you will be able to follow anyway). Read the comments.
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/notifier.php b/include/notifier.php
index c77857087..f64732884 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -366,6 +366,11 @@ function notifier_run($argv, $argc){
$encoded_item = encode_item($target_item);
+ // Send comments to the owner to re-deliver to everybody in the conversation
+ // We only do this if the item in question originated on this site. This prevents looping.
+ // To clarify, a site accepting a new comment is responsible for sending it to the owner for relay.
+ // Relaying should never be initiated on a post that arrived from elsewhere.
+
$relay_to_owner = (((! $top_level_post) && ($target_item['item_flags'] & ITEM_ORIGIN)) ? true : false);
$uplink = false;
@@ -379,7 +384,7 @@ function notifier_run($argv, $argc){
// tag_deliver'd post which needs to be sent back to the original author
- if(($cmd === 'uplink') && ($parent_item['item_flags'] & ITEM_UPLINK) && (! $top_level_post) && (! $deleted_item)) {
+ if(($cmd === 'uplink') && ($parent_item['item_flags'] & ITEM_UPLINK) && (! $top_level_post)) {
logger('notifier: uplink');
$uplink = true;
}
@@ -400,7 +405,7 @@ function notifier_run($argv, $argc){
// 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') && (! $deleted_item)) {
+ 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);
}