+ if($relay_to_owner) {
+ logger('notifier: followup', LOGGER_DEBUG);
+ // local followup to remote post
+ $followup = true;
+ $public_message = false; // not public
+ $conversant_str = dbesc($parent['contact-id']);
+ }
+ else {
+ $followup = false;
+
+ // don't send deletions onward for other people's stuff
+
+ if($target_item['deleted'] && (! intval($target_item['wall']))) {
+ logger('notifier: ignoring delete notification for non-wall item');
+ return;
+ }
+
+ if((strlen($parent['allow_cid']))
+ || (strlen($parent['allow_gid']))
+ || (strlen($parent['deny_cid']))
+ || (strlen($parent['deny_gid']))) {
+ $public_message = false; // private recipients, not public
+ }
+
+ $allow_people = expand_acl($parent['allow_cid']);
+ $allow_groups = expand_groups(expand_acl($parent['allow_gid']));
+ $deny_people = expand_acl($parent['deny_cid']);
+ $deny_groups = expand_groups(expand_acl($parent['deny_gid']));
+
+ // if our parent is a forum, uplink to the origonal author causing
+ // a delivery fork
+
+ if(intval($parent['forum_mode']) && (! $top_level) && ($cmd !== 'uplink')) {
+ proc_run('php','include/notifier','uplink',$item_id);
+ }
+
+ $conversants = array();
+
+ foreach($items as $item) {
+ $recipients[] = $item['contact-id'];
+ $conversants[] = $item['contact-id'];
+ // pull out additional tagged people to notify (if public message)
+ if($public_message && strlen($item['inform'])) {
+ $people = explode(',',$item['inform']);
+ foreach($people as $person) {
+ if(substr($person,0,4) === 'cid:') {
+ $recipients[] = intval(substr($person,4));
+ $conversants[] = intval(substr($person,4));
+ }
+ else {
+ $url_recipients[] = substr($person,4);
+ }
+ }
+ }
+ }
+
+ logger('notifier: url_recipients' . print_r($url_recipients,true));
+
+ $conversants = array_unique($conversants);
+
+
+ $recipients = array_unique(array_merge($recipients,$allow_people,$allow_groups));
+ $deny = array_unique(array_merge($deny_people,$deny_groups));
+ $recipients = array_diff($recipients,$deny);
+
+ $conversant_str = dbesc(implode(', ',$conversants));
+ }
+
+ $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0");
+
+ if(count($r))
+ $contacts = $r;
+ }
+
+ $feed_template = get_markup_template('atom_feed.tpl');
+ $mail_template = get_markup_template('atom_mail.tpl');