*
*/
-function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $secure_feed = false) {
+function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) {
require_once('library/simplepie/simplepie.inc');
// process any deleted entries
$del_entries = $feed->get_feed_tags(NAMESPACE_TOMB, 'deleted-entry');
- if(is_array($del_entries) && count($del_entries)) {
+ if(is_array($del_entries) && count($del_entries) && $pass != 2) {
foreach($del_entries as $dentry) {
$deleted = false;
if(isset($dentry['attribs']['']['ref'])) {
$parent_uri = $rawthread[0]['attribs']['']['ref'];
}
- if(($is_reply) && is_array($contact)) {
+ if(($is_reply) && is_array($contact) && $pass != 1) {
// Have we seen it? If not, import it.
}
$force_parent = false;
- if($contact['network'] === 'stat') {
+ if($contact['network'] === NETWORK_OSTATUS) {
$force_parent = true;
if(strlen($datarray['title']))
unset($datarray['title']);
$datarray['last-child'] = 1;
}
- if(($contact['network'] === 'feed') || (! strlen($contact['notify']))) {
+ if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) {
// one way feed - no remote comment ability
$datarray['last-child'] = 0;
}
$datarray['author-avatar'] = $contact['thumb'];
}
+ // special handling for events
+
if((x($datarray,'object-type')) && ($datarray['object-type'] === ACTIVITY_OBJ_EVENT)) {
$ev = bbtoevent($datarray['body']);
if(x($ev,'desc') && x($ev,'start')) {
}
-
-
if(! is_array($contact))
return;
- if($contact['network'] === 'stat' || stristr($permalink,'twitter.com')) {
+ if($contact['network'] === NETWORK_OSTATUS || stristr($permalink,'twitter.com')) {
if(strlen($datarray['title']))
unset($datarray['title']);
$datarray['last-child'] = 1;
}
- if(($contact['network'] === 'feed') || (! strlen($contact['notify']))) {
+ if(($contact['network'] === NETWORK_FEED) || (! strlen($contact['notify']))) {
// one way feed - no remote comment ability
$datarray['last-child'] = 0;
}
}
- consume_feed($xml,$importer,$contact,$hub,1, true);
+ consume_feed($xml,$importer,$contact,$hub,1,1);
// do it twice. Ensures that children of parents which may be later in the stream aren't tossed
- consume_feed($xml,$importer,$contact,$hub,1);
+ consume_feed($xml,$importer,$contact,$hub,1,2);
$hubmode = 'subscribe';
if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])
require_once('include/items.php');
- consume_feed($xml,$importer,$contact,$feedhub,1);
+ consume_feed($xml,$importer,$contact,$feedhub,1,1);
// do it a second time so that any children find their parents.
- consume_feed($xml,$importer,$contact,$feedhub,1);
+ consume_feed($xml,$importer,$contact,$feedhub,1,2);
hub_post_return();