diff options
author | Sebastian Egbers <sebastian@egbers.info> | 2012-06-25 13:59:39 +0200 |
---|---|---|
committer | Sebastian Egbers <sebastian@egbers.info> | 2012-06-25 13:59:39 +0200 |
commit | 020deedd7c68ce016b65056062d85567c91c3d37 (patch) | |
tree | b07a71b2d57d5dfae527ab9e2a6f42423bc8b327 /include/items.php | |
parent | cbf1cab0da2b67c8a88f301ce9ce6b83db27ec0b (diff) | |
parent | 7ea5917bf794c431fe304fa25380f19a6927cf63 (diff) | |
download | volse-hubzilla-020deedd7c68ce016b65056062d85567c91c3d37.tar.gz volse-hubzilla-020deedd7c68ce016b65056062d85567c91c3d37.tar.bz2 volse-hubzilla-020deedd7c68ce016b65056062d85567c91c3d37.zip |
Merge branch 'master' of https://github.com/friendica/friendica
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php index 9f90d66e4..e495393fa 100755 --- a/include/items.php +++ b/include/items.php @@ -1726,10 +1726,12 @@ function consume_feed($xml,$importer,&$contact, &$hub, $datedir = 0, $pass = 0) $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr_parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), - dbesc($datarray['verb']) + dbesc($datarray['verb']), + dbesc($parent_uri), + dbesc($parent_uri) ); if($r && count($r)) continue; @@ -2269,12 +2271,13 @@ function local_delivery($importer,$data) { $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' + WHERE `item`.`uri` = '%s' AND (`item`.`parent-uri` = '%s' or `item`.`thr-parent` = '%s') AND `item`.`uid` = %d $sql_extra LIMIT 1", dbesc($parent_uri), dbesc($parent_uri), + dbesc($parent_uri), intval($importer['importer_uid']) ); if($r && count($r)) @@ -2362,7 +2365,7 @@ function local_delivery($importer,$data) { $datarray['gravity'] = GRAVITY_LIKE; $datarray['last-child'] = 0; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s' or `parent-uri` = '%s') and deleted = 0 limit 1", intval($datarray['uid']), intval($datarray['contact-id']), dbesc($datarray['verb']), @@ -2536,10 +2539,12 @@ function local_delivery($importer,$data) { $datarray['type'] = 'activity'; $datarray['gravity'] = GRAVITY_LIKE; // only one like or dislike per person - $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 limit 1", + $r = q("select id from item where uid = %d and `contact-id` = %d and verb ='%s' and deleted = 0 and (`parent-uri` = '%s' OR `thr-parent` = '%s') limit 1", intval($datarray['uid']), intval($datarray['contact-id']), - dbesc($datarray['verb']) + dbesc($datarray['verb']), + dbesc($parent_uri), + dbesc($parent_uri) ); if($r && count($r)) continue; |