- $r = q("SELECT * FROM `contact` WHERE `id` IN ( $conversant_str ) AND `blocked` = 0 AND `pending` = 0 AND `archive` = 0");
-
- if(count($r))
- $contacts = $r;
- }
-
- $feed_template = get_markup_template('atom_feed.tpl');
- $mail_template = get_markup_template('atom_mail.tpl');
-
- $atom = '';
- $slaps = array();
-
- $hubxml = feed_hublinks();
-
- $birthday = feed_birthday($owner['uid'],$owner['timezone']);
-
- if(strlen($birthday))
- $birthday = '<dfrn:birthday>' . xmlify($birthday) . '</dfrn:birthday>';
-
- $atom .= replace_macros($feed_template, array(
- '$version' => xmlify(FRIENDICA_VERSION),
- '$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner['nickname'] ),
- '$feed_title' => xmlify($owner['name']),
- '$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
- '$hub' => $hubxml,
- '$salmon' => '', // private feed, we don't use salmon here
- '$name' => xmlify($owner['name']),
- '$profile_page' => xmlify($owner['url']),
- '$photo' => xmlify($owner['photo']),
- '$thumb' => xmlify($owner['thumb']),
- '$picdate' => xmlify(datetime_convert('UTC','UTC',$owner['avatar-date'] . '+00:00' , ATOM_TIME)) ,
- '$uridate' => xmlify(datetime_convert('UTC','UTC',$owner['uri-date'] . '+00:00' , ATOM_TIME)) ,
- '$namdate' => xmlify(datetime_convert('UTC','UTC',$owner['name-date'] . '+00:00' , ATOM_TIME)) ,
- '$birthday' => $birthday,
- '$community' => (($owner['page-flags'] == PAGE_COMMUNITY) ? '<dfrn:community>1</dfrn:community>' : '')
-
- ));
-
- if($mail) {
- $public_message = false; // mail is not public
-
- $body = fix_private_photos($item['body'],$owner['uid'],null,$message[0]['contact-id']);
-
- $atom .= replace_macros($mail_template, array(
- '$name' => xmlify($owner['name']),
- '$profile_page' => xmlify($owner['url']),
- '$thumb' => xmlify($owner['thumb']),
- '$item_id' => xmlify($item['uri']),
- '$subject' => xmlify($item['title']),
- '$created' => xmlify(datetime_convert('UTC', 'UTC', $item['created'] . '+00:00' , ATOM_TIME)),
- '$content' => xmlify($body),
- '$parent_id' => xmlify($item['parent-uri'])
- ));
- }
- elseif($fsuggest) {
- $public_message = false; // suggestions are not public
-
- $sugg_template = get_markup_template('atom_suggest.tpl');
-
- $atom .= replace_macros($sugg_template, array(
- '$name' => xmlify($item['name']),
- '$url' => xmlify($item['url']),
- '$photo' => xmlify($item['photo']),
- '$request' => xmlify($item['request']),
- '$note' => xmlify($item['note'])
- ));
-
- // We don't need this any more
-
- q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1",
- intval($item['id'])
- );
-
- }
- elseif($relocate) {
- $public_message = false; // suggestions are not public
-
- $sugg_template = get_markup_template('atom_relocate.tpl');
-
- $atom .= replace_macros($sugg_template, array(
- '$name' => xmlfy($owner['name']),
- '$photo' => xmlfy($owner['photo']),
- '$thumb' => xmlfy($owner['thumb']),
- '$micro' => xmlfy($owner['micro']),
- '$url' => xmlfy($owner['url']),
- '$request' => xmlfy($owner['request']),
- '$confirm' => xmlfy($owner['confirm']),
- '$notify' => xmlfy($owner['notify']),
- '$poll' => xmlfy($owner['poll']),
- '$site-pubkey' => xmlfy(get_config('system','site_pubkey')),
- //'$pubkey' => xmlfy($owner['pubkey']),
- //'$prvkey' => xmlfy($owner['prvkey']),
- ));
- $recipients_relocate = q("SELECT * FROM contacts WHERE uid = %d AND self = 0 AND network = '%s'" , intval($uid), NETWORK_DFRN);
-
-
- }
- else {
- if($followup) {
- foreach($items as $item) { // there is only one item
- if(! $item['parent'])
- continue;
- if($item['id'] == $item_id) {
- logger('notifier: followup: item: ' . print_r($item,true), LOGGER_DATA);
- $slap = atom_entry($item,'html',null,$owner,false);
- $atom .= atom_entry($item,'text',null,$owner,false);