]> git.mxchange.org Git - friendica.git/blobdiff - mod/like.php
Merge pull request #429 from CyberDomovoy/threaded_items
[friendica.git] / mod / like.php
index 5519bffdb85c50b0e289668765d5fc2527fbcffe..aaa85928c7c81059984e47bf55c9995480c1e9bf 100755 (executable)
@@ -106,17 +106,18 @@ function like_content(&$a) {
 
 
        $r = q("SELECT * FROM `item` WHERE `verb` = '%s' AND `deleted` = 0 
-               AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s') LIMIT 1",
+               AND `contact-id` = %d AND ( `parent` = '%s' OR `parent-uri` = '%s' OR `thr-parent` = '%s') LIMIT 1",
                dbesc($activity),
                intval($contact['id']),
                dbesc($item_id),
-               dbesc($item_id)
+               dbesc($item_id),
+               dbesc($item['uri'])
        );
        if(count($r)) {
                $like_item = $r[0];
 
                // Already voted, undo it
-               $r = q("UPDATE `item` SET `deleted` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
+               $r = q("UPDATE `item` SET `deleted` = 1, `unseen` = 1, `changed` = '%s' WHERE `id` = %d LIMIT 1",
                        dbesc(datetime_convert()),
                        intval($like_item['id'])
                );