aboutsummaryrefslogtreecommitdiffstats
path: root/mod/like.php
diff options
context:
space:
mode:
authorHabeas Codice <habeascodice@federated.social>2014-11-19 21:11:11 -0800
committerHabeas Codice <habeascodice@federated.social>2014-11-19 21:11:11 -0800
commitc8af19c69c03b39d5eded833a2d9d8ed9ab5826c (patch)
tree16ded6330f1baa9d8e889978c9e093f1e90d7d85 /mod/like.php
parent92d0a9404ff92da23b558f9a73a3150f97b6a08e (diff)
parent18cae8a78cb3df8ffcd9e4787c3b572c799036da (diff)
downloadvolse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.tar.gz
volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.tar.bz2
volse-hubzilla-c8af19c69c03b39d5eded833a2d9d8ed9ab5826c.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'mod/like.php')
-rwxr-xr-xmod/like.php18
1 files changed, 5 insertions, 13 deletions
diff --git a/mod/like.php b/mod/like.php
index b56611197..04a2b43cd 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -263,26 +263,18 @@ function like_content(&$a) {
else
killme();
-
- $r = q("SELECT * FROM item WHERE verb = '%s' AND item_restrict = 0
+ $r = q("SELECT id FROM item WHERE verb = '%s' AND item_restrict = 0
AND author_xchan = '%s' AND ( parent = %d OR thr_parent = '%s') LIMIT 1",
dbesc($activity),
dbesc($observer['xchan_hash']),
intval($item_id),
dbesc($item['mid'])
);
- if($r) {
- $like_item = $r[0];
-
- // Already liked/disliked it, delete it
- $r = q("UPDATE item SET item_restrict = ( item_restrict & ~%d ), changed = '%s' WHERE id = %d",
- intval(ITEM_DELETED),
- dbesc(datetime_convert()),
- intval($like_item['id'])
- );
-
- proc_run('php',"include/notifier.php","like",$like_item['id']);
+ if($r) {
+ // already liked it. Drop that item.
+ require_once('include/items.php');
+ drop_item($r[0]['id'],false,DROPITEM_PHASE1);
return;
}