Bugfix: The duplicate check for likes wasn't reliable
This commit is contained in:
@@ -3717,7 +3717,7 @@ function local_delivery($importer,$data) {
|
||||
$datarray['owner-avatar'] = $own[0]['thumb'];
|
||||
$datarray['contact-id'] = $importer['id'];
|
||||
|
||||
if(($datarray['verb'] === ACTIVITY_LIKE)
|
||||
if(($datarray['verb'] === ACTIVITY_LIKE)
|
||||
|| ($datarray['verb'] === ACTIVITY_DISLIKE)
|
||||
|| ($datarray['verb'] === ACTIVITY_ATTEND)
|
||||
|| ($datarray['verb'] === ACTIVITY_ATTENDNO)
|
||||
@@ -3728,9 +3728,9 @@ function local_delivery($importer,$data) {
|
||||
$datarray['last-child'] = 0;
|
||||
// only one like or dislike per person
|
||||
// splitted into two queries for performance issues
|
||||
$r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`parent-uri` = '%s') and deleted = 0 limit 1",
|
||||
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `author-link` = '%s' AND `verb` = '%s' AND `parent-uri` = '%s' AND NOT `deleted` LIMIT 1",
|
||||
intval($datarray['uid']),
|
||||
intval($datarray['contact-id']),
|
||||
dbesc($datarray['author-link']),
|
||||
dbesc($datarray['verb']),
|
||||
dbesc($datarray['parent-uri'])
|
||||
|
||||
@@ -3738,9 +3738,9 @@ function local_delivery($importer,$data) {
|
||||
if($r && count($r))
|
||||
continue;
|
||||
|
||||
$r = q("select id from item where uid = %d and `contact-id` = %d and verb = '%s' and (`thr-parent` = '%s') and deleted = 0 limit 1",
|
||||
$r = q("SELECT `id` FROM `item` WHERE `uid` = %d AND `author-link` = '%s' AND `verb` = '%s' AND `thr-parent` = '%s' AND NOT `deleted` LIMIT 1",
|
||||
intval($datarray['uid']),
|
||||
intval($datarray['contact-id']),
|
||||
dbesc($datarray['author-link']),
|
||||
dbesc($datarray['verb']),
|
||||
dbesc($datarray['parent-uri'])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user