aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-02-03 17:40:04 -0800
committerFriendika <info@friendika.com>2011-02-03 17:40:04 -0800
commitc6b00f72305d467cb5eda32ed6499f81610d4338 (patch)
treea93f554ff92e0cd27b29d83501530bdbfebd37ce /include
parente2c8bedfe57501f0ac15b09c053f603ea99344d6 (diff)
downloadvolse-hubzilla-c6b00f72305d467cb5eda32ed6499f81610d4338.tar.gz
volse-hubzilla-c6b00f72305d467cb5eda32ed6499f81610d4338.tar.bz2
volse-hubzilla-c6b00f72305d467cb5eda32ed6499f81610d4338.zip
allow parentless items from SN - add more tracing on notify failures
Diffstat (limited to 'include')
-rw-r--r--include/items.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php
index 9f693e60d..45d8b62c0 100644
--- a/include/items.php
+++ b/include/items.php
@@ -611,7 +611,7 @@ function encode_rel_links($links) {
return xmlify($o);
}
-function item_store($arr) {
+function item_store($arr,$force_parent = false) {
if($arr['gravity'])
$arr['gravity'] = intval($arr['gravity']);
@@ -695,8 +695,20 @@ function item_store($arr) {
$deny_gid = $r[0]['deny_gid'];
}
else {
- logger('item_store: item parent was not found - ignoring item');
- return 0;
+
+ // Allow one to see reply tweets from status.net even when
+ // we don't have or can't see the original post.
+
+ if($force_parent) {
+ logger('item_store: $force_parent=true, reply converted to top-level post.');
+ $parent_id = 0;
+ $arr['thr-parent'] = $arr['parent-uri'];
+ $arr['parent-uri'] = $arr['uri'];
+ }
+ else {
+ logger('item_store: item parent was not found - ignoring item');
+ return 0;
+ }
}
}
@@ -1194,8 +1206,9 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
continue;
}
$datarray = get_atom_elements($feed,$item);
-
+ $force_parent = false;
if($contact['network'] === 'stat') {
+ $force_parent = true;
if(strlen($datarray['title']))
unset($datarray['title']);
$r = q("UPDATE `item` SET `last-child` = 0, `changed` = '%s' WHERE `parent-uri` = '%s' AND `uid` = %d",
@@ -1218,7 +1231,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0) {
$datarray['gravity'] = GRAVITY_LIKE;
}
- $r = item_store($datarray);
+ $r = item_store($datarray,$force_parent);
continue;
}