From ed14c1f224afadb5dd5417d4078f853ff97b30cb Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 26 Mar 2014 18:45:01 -0700 Subject: more work on firehose --- include/zot.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index c82918b3a..186f1da10 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1354,16 +1354,18 @@ function allowed_public_recips($msg) { } -function process_delivery($sender,$arr,$deliveries,$relay) { +function process_delivery($sender,$arr,$deliveries,$relay,$public = false) { $result = array(); // We've validated the sender. Now make sure that the sender is the owner or author - if($sender['hash'] != $arr['owner_xchan'] && $sender['hash'] != $arr['author_xchan']) { - logger("process_delivery: sender {$sender['hash']} is not owner {$arr['owner_xchan']} or author {$arr['author_xchan']} - mid {$arr['mid']}"); - return; + if(! $public) { + if($sender['hash'] != $arr['owner_xchan'] && $sender['hash'] != $arr['author_xchan']) { + logger("process_delivery: sender {$sender['hash']} is not owner {$arr['owner_xchan']} or author {$arr['author_xchan']} - mid {$arr['mid']}"); + return; + } } foreach($deliveries as $d) { @@ -1394,7 +1396,7 @@ function process_delivery($sender,$arr,$deliveries,$relay) { } } - if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery)) { + if((! perm_is_allowed($channel['channel_id'],$sender['hash'],$perm)) && (! $tag_delivery) && (! $public)) { logger("permission denied for delivery {$channel['channel_id']}"); $result[] = array($d['hash'],'permission denied',$channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>'); continue; -- cgit v1.2.3