aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorMichael <icarus@dabo.de>2012-02-23 20:53:22 +0100
committerMichael <icarus@dabo.de>2012-02-23 20:53:22 +0100
commit0409b5cdba003b6ce90d5ad0181e81c06af95ab1 (patch)
treec677adb7c0e8140bdb1e115a95d1aa23fdf734ed /include/items.php
parent311e35731c52102cbce3befc6343f179080ad38c (diff)
parent8cacff69858c2ad097bafb80c93405e79c311edf (diff)
downloadvolse-hubzilla-0409b5cdba003b6ce90d5ad0181e81c06af95ab1.tar.gz
volse-hubzilla-0409b5cdba003b6ce90d5ad0181e81c06af95ab1.tar.bz2
volse-hubzilla-0409b5cdba003b6ce90d5ad0181e81c06af95ab1.zip
Merge remote branch 'upstream/master'
Conflicts: include/bbcode.php
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php34
1 files changed, 25 insertions, 9 deletions
diff --git a/include/items.php b/include/items.php
index f4837449d..347826042 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1551,8 +1551,9 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
}
$force_parent = false;
- if($contact['network'] === NETWORK_OSTATUS) {
- $force_parent = true;
+ if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
+ if($contact['network'] === NETWORK_OSTATUS)
+ $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",
@@ -1700,7 +1701,7 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0)
if(! is_array($contact))
return;
- if($contact['network'] === NETWORK_OSTATUS || stristr($permalink,'twitter.com')) {
+ if($contact['network'] === NETWORK_OSTATUS || stristr($contact['url'],'twitter.com')) {
if(strlen($datarray['title']))
unset($datarray['title']);
$datarray['last-child'] = 1;
@@ -2040,13 +2041,12 @@ function local_delivery($importer,$data) {
}
if($is_reply) {
-
$community = false;
if($importer['page-flags'] == PAGE_COMMUNITY) {
$sql_extra = '';
$community = true;
- logger('local_delivery: community reply');
+ logger('local_delivery: possible community reply');
}
else
$sql_extra = " and contact.self = 1 and item.wall = 1 ";
@@ -2054,7 +2054,9 @@ function local_delivery($importer,$data) {
// was the top-level post for this reply written by somebody on this site?
// Specifically, the recipient?
- $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`,
+ $is_a_remote_comment = false;
+
+ $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`,`item`.`wall`,
`contact`.`name`, `contact`.`url`, `contact`.`thumb` from `item`
LEFT JOIN `contact` ON `contact`.`id` = `item`.`contact-id`
WHERE `item`.`uri` = '%s' AND `item`.`parent-uri` = '%s'
@@ -2065,16 +2067,29 @@ function local_delivery($importer,$data) {
dbesc($parent_uri),
intval($importer['importer_uid'])
);
+ if($r && count($r))
+ $is_a_remote_comment = true;
+
+ // Does this have the characteristics of a community comment?
+ // If it's a reply to a wall post on a community page it's a
+ // valid community comment. Also forum_mode makes it valid for sure.
+ // If neither, it's not.
+
+ if($is_a_remote_comment && $community) {
+ if((! $r[0]['forum_mode']) && (! $r[0]['wall'])) {
+ $is_a_remote_comment = false;
+ logger('local_delivery: not a community reply');
+ }
+ }
- if($r && count($r)) {
-
+ if($is_a_remote_comment) {
logger('local_delivery: received remote comment');
$is_like = false;
// remote reply to our post. Import and then notify everybody else.
$datarray = get_atom_elements($feed,$item);
- // TODO: make this next part work against both delivery threads of a community post
+ // TODO: make this next part work against both delivery threads of a community post
// if((! link_compare($datarray['author-link'],$importer['url'])) && (! $community)) {
// logger('local_delivery: received relay claiming to be from ' . $importer['url'] . ' however comment author url is ' . $datarray['author-link'] );
@@ -2188,6 +2203,7 @@ function local_delivery($importer,$data) {
}
}
+
return 0;
// NOTREACHED
}