diff options
author | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-01-25 08:54:10 +0100 |
---|---|---|
committer | Tobias Diekershoff <tobias.diekershoff@gmx.net> | 2011-01-25 08:54:10 +0100 |
commit | 4c717b38ae8eccaf9fa2ab4e6411b10c2d24afdf (patch) | |
tree | 1dd91abe675ad2b8c98dccba6930144e1f73b33c /include | |
parent | 7e007b6c07d5395c59797999728fcde288ed79b1 (diff) | |
parent | bb1afd867d1b7bd98930108727b88a066af9749d (diff) | |
download | volse-hubzilla-4c717b38ae8eccaf9fa2ab4e6411b10c2d24afdf.tar.gz volse-hubzilla-4c717b38ae8eccaf9fa2ab4e6411b10c2d24afdf.tar.bz2 volse-hubzilla-4c717b38ae8eccaf9fa2ab4e6411b10c2d24afdf.zip |
Merge branch 'master' of git://github.com/tobiasd/friendika
Diffstat (limited to 'include')
-rw-r--r-- | include/Scrape.php | 2 | ||||
-rw-r--r-- | include/items.php | 26 |
2 files changed, 24 insertions, 4 deletions
diff --git a/include/Scrape.php b/include/Scrape.php index 8478ea407..e4f7a0878 100644 --- a/include/Scrape.php +++ b/include/Scrape.php @@ -161,6 +161,8 @@ function scrape_feed($url) { $x = $item->getAttribute('rel'); if(($x === 'alternate') && ($item->getAttribute('type') === 'application/atom+xml')) $ret['feed_atom'] = $item->getAttribute('href'); + if(($x === 'alternate') && ($item->getAttribute('type') === 'application/rss+xml')) + $ret['feed_rss'] = $item->getAttribute('href'); } return $ret; diff --git a/include/items.php b/include/items.php index 5f8264beb..cbe0e970d 100644 --- a/include/items.php +++ b/include/items.php @@ -423,19 +423,29 @@ function get_atom_elements($feed,$item) { else $res['private'] = 0; - $rawcreated = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'published'); - if($rawcreated) - $res['created'] = unxmlify($rawcreated[0]['data']); $rawlocation = $item->get_item_tags(NAMESPACE_DFRN, 'location'); if($rawlocation) $res['location'] = unxmlify($rawlocation[0]['data']); + $rawcreated = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'published'); + if($rawcreated) + $res['created'] = unxmlify($rawcreated[0]['data']); + + $rawedited = $item->get_item_tags(SIMPLEPIE_NAMESPACE_ATOM_10,'updated'); if($rawedited) $res['edited'] = unxmlify($rawcreated[0]['data']); + + if(! $res['created']) + $res['created'] = $item->get_date(); + + if(! $res['edited']) + $res['edited'] = $item->get_date(); + + $rawowner = $item->get_item_tags(NAMESPACE_DFRN, 'owner'); if($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']) $res['owner-name'] = unxmlify($rawowner[0]['child'][SIMPLEPIE_NAMESPACE_ATOM_10]['name'][0]['data']); @@ -1155,6 +1165,10 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) { ); $datarray['last-child'] = 1; } + if(($contact['network'] === 'feed') || (! strlen($contact['poll']))) { + // one way feed - no remote comment ability + $datarray['last-child'] = 0; + } $datarray['parent-uri'] = $parent_uri; $datarray['uid'] = $importer['uid']; $datarray['contact-id'] = $contact['id']; @@ -1207,6 +1221,11 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) { $datarray['last-child'] = 1; } + if(($contact['network'] === 'feed') || (! strlen($contact['poll']))) { + // one way feed - no remote comment ability + $datarray['last-child'] = 0; + } + $datarray['parent-uri'] = $item_id; $datarray['uid'] = $importer['uid']; $datarray['contact-id'] = $contact['id']; @@ -1216,7 +1235,6 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) { } } } - } function new_follower($importer,$contact,$datarray,$item) { |