- case NETWORK_DFRN :
- logger('notifier: dfrndelivery: ' . $contact['name']);
-
- $feed_template = get_markup_template('atom_feed.tpl');
- $mail_template = get_markup_template('atom_mail.tpl');
-
- $atom = '';
-
-
- $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>' : '')
- ));
-
- foreach($items as $item) {
- if(! $item['parent'])
- continue;
-
- // private emails may be in included in public conversations. Filter them.
- if(($public_message) && $item['private'] == 1)
- continue;
-
- $item_contact = get_item_contact($item,$icontacts);
- if(! $item_contact)
- continue;
-
- if($normal_mode) {
- if($item_id == $item['id'] || $item['id'] == $item['parent'])
- $atom .= atom_entry($item,'text',null,$owner,true,(($top_level) ? $contact['id'] : 0));
+ case NETWORK_DFRN:
+ logger('notifier: '.$target_item["guid"].' dfrndelivery: '.$contact['name']);
+
+ if ($mail) {
+ $item['body'] = fix_private_photos($item['body'],$owner['uid'],null,$message[0]['contact-id']);
+ $atom = dfrn::mail($item, $owner);
+ } elseif ($fsuggest) {
+ $atom = dfrn::fsuggest($item, $owner);
+ q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id']));
+ } elseif ($relocate) {
+ $atom = dfrn::relocate($owner, $uid);
+ } elseif ($followup) {
+ $msgitems = array();
+ foreach ($items as $item) { // there is only one item
+ if (!$item['parent']) {
+ continue;
+ }
+ if ($item['id'] == $item_id) {
+ logger('followup: item: '. print_r($item,true), LOGGER_DATA);
+ $msgitems[] = $item;
+ }