diff options
author | friendica <info@friendica.com> | 2012-06-23 21:11:18 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-06-23 21:11:18 -0700 |
commit | 1574396d04ead2e410aa992b049fe63422080bab (patch) | |
tree | 0c130e8e4816e59ae6e25db3c506095724cce7f3 /include/items.php | |
parent | 098c74a12a7b370ccd9ca6d10987feac4b0d61d3 (diff) | |
download | volse-hubzilla-1574396d04ead2e410aa992b049fe63422080bab.tar.gz volse-hubzilla-1574396d04ead2e410aa992b049fe63422080bab.tar.bz2 volse-hubzilla-1574396d04ead2e410aa992b049fe63422080bab.zip |
sort out some "like" issues
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/include/items.php b/include/items.php index 91ed6762c..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; @@ -2363,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']), @@ -2537,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; |