From ccf44f2514856161a1650781b57d90c75e3d110e Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 25 Nov 2012 23:18:11 -0800 Subject: more but slow progress on deliveries. The b*tch is trying to match permissions --- include/zot.php | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'include/zot.php') diff --git a/include/zot.php b/include/zot.php index ba2a6a834..1924f3b23 100644 --- a/include/zot.php +++ b/include/zot.php @@ -614,21 +614,43 @@ function zot_import($arr) { $incoming = $data['pickup']; if(is_array($incoming)) { foreach($incoming as $i) { + + $deliveries = null; + if($i['notify'] && $i['notify']['recipients']) { - // look for our site members in the recipient list - // (fix the notifier to send them...) + $recip_arr = array(); + foreach($i['notify']['recipients'] as $recip) { + $recip_arr[] = array('hash' => base64url_encode(hash('whirlpool',$recip['guid'] . $recip['guid_sig'], true))); + } + stringify_array_elms($recip_arr); + $recips = ids_to_querystr($recip_arr,'hash'); + + $r = q("select * from channel where channel_hash in ( " . $recips . " ) "); + if(! $r) + continue; + + $deliveries = $r; + + // We found somebody on this site that's in the recipient list. + } else { - // look for any site members who are accepting posts from this sender - } - if($i['message'] && $i['message']['type'] === 'activity') { - // process the message + // Public post. look for any site members who are accepting posts from this sender + } + if(! $deliveries) + continue; + if($i['message']) { + if($i['message']['type'] === 'activity') { + // process the message + } + elseif($i['message']['type'] === 'mail') { + } } } } -- cgit v1.2.3