aboutsummaryrefslogtreecommitdiffstats
path: root/include/feedutils.php
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2017-07-26 17:38:34 -0700
committerzotlabs <mike@macgirvin.com>2017-07-26 17:38:34 -0700
commitdbbae4bac81d18f814c18ac8d0ea51667e00703f (patch)
tree795cd98c903c13416f8238219907526cc62fb884 /include/feedutils.php
parent9132b9c02661586a54823517c331fb718a9cbd17 (diff)
downloadvolse-hubzilla-dbbae4bac81d18f814c18ac8d0ea51667e00703f.tar.gz
volse-hubzilla-dbbae4bac81d18f814c18ac8d0ea51667e00703f.tar.bz2
volse-hubzilla-dbbae4bac81d18f814c18ac8d0ea51667e00703f.zip
issue with OStatus comments being propagated downstream
Diffstat (limited to 'include/feedutils.php')
-rw-r--r--include/feedutils.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/feedutils.php b/include/feedutils.php
index e660574ed..eb24f9032 100644
--- a/include/feedutils.php
+++ b/include/feedutils.php
@@ -999,6 +999,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
foreach($items as $item) {
$is_reply = false;
+ $send_downstream = false;
$parent_link = '';
logger('processing ' . $item->get_id(), LOGGER_DEBUG);
@@ -1200,6 +1201,15 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$status = 202;
continue;
}
+
+ // The salmon endpoint sets this to indicate that we should send comments from
+ // interactive feeds (such as OStatus) downstream to our followers
+ // We do not want to set it for non-interactive feeds or conversations we do not own
+
+ if(array_key_exists('send_downstream',$importer) && intval($importer['send_downstream'])
+ && ($parent_item['owner_xchan'] == $importer['channel_hash'])) {
+ $send_downstream = true;
+ }
}
else {
if((! perm_is_allowed($importer['channel_id'],$contact['xchan_hash'],'send_stream')) && (! $importer['system'])) {
@@ -1229,6 +1239,11 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) {
$xx = item_store($datarray);
$r = $xx['item_id'];
+
+ if($send_downstream) {
+ \Zotlabs\Daemon\Master::Summon(array('Notifier', 'comment', $r));
+ }
+
continue;
}
else {