aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-08-31 20:51:05 -0700
committerfriendica <info@friendica.com>2014-08-31 20:51:05 -0700
commita63de472cf1b5cff1ebda821d3a6ba39cf37f839 (patch)
tree7150f4d658a6c9b22dbe4c56dfdc8be8961ae1db /include/items.php
parent89d5c42df16ccef9c6c849a98d37e58bbf3dd49a (diff)
downloadvolse-hubzilla-a63de472cf1b5cff1ebda821d3a6ba39cf37f839.tar.gz
volse-hubzilla-a63de472cf1b5cff1ebda821d3a6ba39cf37f839.tar.bz2
volse-hubzilla-a63de472cf1b5cff1ebda821d3a6ba39cf37f839.zip
various rss fixes
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php31
1 files changed, 20 insertions, 11 deletions
diff --git a/include/items.php b/include/items.php
index 4614aa642..f489eeb0a 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1499,6 +1499,9 @@ function get_atom_elements($feed,$item,&$author) {
if($d2 > $d3)
$res['edited'] = datetime_convert();
+ $res['created'] = datetime_convert('UTC','UTC',$res['created']);
+ $res['edited'] = datetime_convert('UTC','UTC',$res['edited']);
+
$rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner');
if(! $rawowner)
$rawowner = $item->get_item_tags(NAMESPACE_ZOT,'owner');
@@ -1560,7 +1563,7 @@ function get_atom_elements($feed,$item,&$author) {
$termterm = notags(trim(unxmlify($term)));
if($termterm) {
- $terms = array(
+ $terms[] = array(
'otype' => TERM_OBJ_POST,
'type' => $termtype,
'url' => $termurl,
@@ -1568,7 +1571,7 @@ function get_atom_elements($feed,$item,&$author) {
);
}
}
- $res['term'] = implode(',', $tag_arr);
+ $res['term'] = $terms;
}
$attach = $item->get_enclosures();
@@ -1663,6 +1666,9 @@ function get_atom_elements($feed,$item,&$author) {
$res['target'] = $obj;
}
+ $res['public_policy'] = 'specific';
+ $res['comment_policy'] = 'none';
+
$arr = array('feed' => $feed, 'item' => $item, 'result' => $res);
call_hooks('parse_atom', $arr);
@@ -3207,14 +3213,14 @@ function consume_feed($xml,$importer,&$contact,$pass = 0) {
$datarray['uid'] = $importer['channel_id'];
//FIXME
- $datarray['author_xchan'] = $contact['xchan_hash'];
+ $datarray['owner_xchan'] = $datarray['author_xchan'] = $contact['xchan_hash'];
// FIXME pull out the author and owner
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
-// $xx = item_store($datarray);
+ $xx = item_store($datarray);
$r = $xx['item_id'];
continue;
}
@@ -3267,18 +3273,21 @@ function consume_feed($xml,$importer,&$contact,$pass = 0) {
$datarray['parent_mid'] = $item_id;
$datarray['uid'] = $importer['channel_id'];
//FIXME
- $datarray['author_xchan'] = $contact['author_xchan'];
-
+ $datarray['owner_xchan'] = $datarray['author_xchan'] = $contact['xchan_hash'];
+
if(! link_compare($author['owner_link'],$contact['xchan_url'])) {
logger('consume_feed: Correcting item owner.', LOGGER_DEBUG);
- $author['owner-name'] = $contact['name'];
- $author['owner-link'] = $contact['url'];
- $author['owner-avatar'] = $contact['thumb'];
+ $author['owner_name'] = $contact['name'];
+ $author['owner_link'] = $contact['url'];
+ $author['owner_avatar'] = $contact['thumb'];
}
+ logger('consume_feed: author ' . print_r($author,true));
+
+
logger('consume_feed: ' . print_r($datarray,true),LOGGER_DATA);
-// $xx = item_store($datarray);
+ $xx = item_store($datarray);
$r = $xx['item_id'];
continue;
@@ -3311,7 +3320,7 @@ function handle_feed($uid,$abook_id,$url) {
$recurse = 0;
$z = z_fetch_url($url,false,$recurse,array('novalidate' => true));
-logger('handle_feed:' . print_r($z,true));
+//logger('handle_feed:' . print_r($z,true));
if($z['success']) {
consume_feed($z['body'],$channel,$x[0],0);