aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-09-09 22:03:23 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-09-09 22:03:23 -0700
commitf2889d24e6bef4c530b233d0b4359d140574b57b (patch)
tree8254b2c2dcd5e1697cf1a6983ddc73d33c4ad552
parentdb58b6223503a63f92cccddd87179ae8e3ae1e46 (diff)
downloadvolse-hubzilla-f2889d24e6bef4c530b233d0b4359d140574b57b.tar.gz
volse-hubzilla-f2889d24e6bef4c530b233d0b4359d140574b57b.tar.bz2
volse-hubzilla-f2889d24e6bef4c530b233d0b4359d140574b57b.zip
decentralise likes of things so they can be cloned
-rwxr-xr-xmod/like.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/mod/like.php b/mod/like.php
index 42ff9bb8a..87f012874 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -222,10 +222,17 @@ function like_content(&$a) {
q("delete from likes where id = %d limit 1",
intval($z[0]['id'])
);
- drop_item($z[0]['iid'],false);
- if($interactive) {
- notice( t('Previous action reversed.') . EOL);
- return $o;
+ if($z[0]['i_mid']) {
+ $r = q("select id from item where mid = '%s' and uid = %d limit 1",
+ dbesc($z[0]['i_mid']),
+ intval($ch[0]['channel_id'])
+ );
+ if($r)
+ drop_item($r[0]['id'],false);
+ if($interactive) {
+ notice( t('Previous action reversed.') . EOL);
+ return $o;
+ }
}
killme();
}