diff options
author | friendica <info@friendica.com> | 2012-02-20 21:07:40 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-02-20 21:07:40 -0800 |
commit | 32d9008dd4f9de8f23fce663f843de0ec81c3250 (patch) | |
tree | e0acd7c4962b8378ffddc95dbbcebcd929d25554 /include/items.php | |
parent | b821399f001cd4082707ba9fb6df9c419e0b8e5e (diff) | |
download | volse-hubzilla-32d9008dd4f9de8f23fce663f843de0ec81c3250.tar.gz volse-hubzilla-32d9008dd4f9de8f23fce663f843de0ec81c3250.tar.bz2 volse-hubzilla-32d9008dd4f9de8f23fce663f843de0ec81c3250.zip |
more cleanup of community followup detection. Remote worked well but local didn't.
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php index 5beccfbe7..3db56da5f 100755 --- a/include/items.php +++ b/include/items.php @@ -2045,7 +2045,7 @@ function local_delivery($importer,$data) { 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 "; @@ -2055,7 +2055,7 @@ function local_delivery($importer,$data) { $is_a_remote_comment = false; - $r = q("select `item`.`id`, `item`.`uri`, `item`.`tag`, `item`.`forum_mode`,`item`.`origin`, + $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' @@ -2069,8 +2069,17 @@ function local_delivery($importer,$data) { if($r && count($r)) $is_a_remote_comment = true; - if(($community) && (! $r[0]['forum_mode'])) - $is_a_remote_comment = false; + // 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($is_a_remote_comment) { logger('local_delivery: received remote comment'); |