diff --git a/include/delivery.php b/include/delivery.php index 957681ead5..d046005994 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -265,8 +265,6 @@ function delivery_run(&$argv, &$argc){ if(count($r)) $contact = $r[0]; - //$hubxml = feed_hublinks(); - if($contact['self']) continue; @@ -284,7 +282,7 @@ function delivery_run(&$argv, &$argc){ $atom = dfrn_mail($item, $owner); } elseif ($fsuggest) { $atom = dfrn_fsuggest($item, $owner); - // q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id']) + q("DELETE FROM `fsuggest` WHERE `id` = %d LIMIT 1", intval($item['id'])); } elseif ($relocate) $atom = dfrn_relocate($owner, $uid); elseif($followup) { @@ -325,138 +323,7 @@ function delivery_run(&$argv, &$argc){ } $atom = dfrn_entries($msgitems,$owner); } -/* - $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 = '' . xmlify($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) ? '1' : '') - )); - - 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'); - - // get site pubkey. this could be a new installation with no site keys - $pubkey = get_config('system','site_pubkey'); - if(! $pubkey) { - $res = new_keypair(1024); - set_config('system','site_prvkey', $res['prvkey']); - set_config('system','site_pubkey', $res['pubkey']); - } - - $rp = q("SELECT `resource-id` , `scale`, type FROM `photo` - WHERE `profile` = 1 AND `uid` = %d ORDER BY scale;", $uid); - $photos = array(); - $ext = Photo::supportedTypes(); - foreach($rp as $p){ - $photos[$p['scale']] = $a->get_baseurl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']]; - } - unset($rp, $ext); - - $atom .= replace_macros($sugg_template, array( - '$name' => xmlify($owner['name']), - '$photo' => xmlify($photos[4]), - '$thumb' => xmlify($photos[5]), - '$micro' => xmlify($photos[6]), - '$url' => xmlify($owner['url']), - '$request' => xmlify($owner['request']), - '$confirm' => xmlify($owner['confirm']), - '$notify' => xmlify($owner['notify']), - '$poll' => xmlify($owner['poll']), - '$sitepubkey' => xmlify(get_config('system','site_pubkey')), - //'$pubkey' => xmlify($owner['pubkey']), - //'$prvkey' => xmlify($owner['prvkey']), - )); - unset($photos); - } elseif($followup) { - 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); - $atom .= atom_entry($item,'text',null,$owner,false); - } - } - } else { - 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)); - } else - $atom .= atom_entry($item,'text',null,$owner,true); - } - } - - $atom .= '' . "\r\n"; -*/ logger('notifier entry: '.$contact["url"].' '.$target_item["guid"].' entry: '.$atom, LOGGER_DEBUG); logger('notifier: ' . $atom, LOGGER_DATA); diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php index e6ebc5d519..658a248c62 100644 --- a/mod/dfrn_poll.php +++ b/mod/dfrn_poll.php @@ -44,7 +44,6 @@ function dfrn_poll_init(&$a) { logger('dfrn_poll: public feed request from ' . $_SERVER['REMOTE_ADDR'] . ' for ' . $user); header("Content-type: application/atom+xml"); - //echo get_feed_for($a, '', $user,$last_update); echo dfrn_feed($a, '', $user,$last_update); killme(); } @@ -372,7 +371,6 @@ function dfrn_poll_post(&$a) { } header("Content-type: application/atom+xml"); - //$o = get_feed_for($a,$dfrn_id, $a->argv[1], $last_update, $direction); $o = dfrn_feed($a,$dfrn_id, $a->argv[1], $last_update, $direction); echo $o; killme();