aboutsummaryrefslogtreecommitdiffstats
path: root/mod/like.php
diff options
context:
space:
mode:
authorStefan Parviainen <saparvia@caterva.eu>2014-11-08 20:53:41 +0100
committerStefan Parviainen <saparvia@caterva.eu>2014-11-08 20:53:41 +0100
commitb5fad9feefd0f261807222d8a4c42ead6253a65c (patch)
tree399cd4a1b79f61530924ea59670af0bdd6cee5be /mod/like.php
parent89aea081825ec7b11b00833a9bec2c74900bfcb6 (diff)
parentb29a968be8df52cd7c9b6d5bebb618534788337c (diff)
downloadvolse-hubzilla-b5fad9feefd0f261807222d8a4c42ead6253a65c.tar.gz
volse-hubzilla-b5fad9feefd0f261807222d8a4c42ead6253a65c.tar.bz2
volse-hubzilla-b5fad9feefd0f261807222d8a4c42ead6253a65c.zip
Fix merge conflict
Diffstat (limited to 'mod/like.php')
-rwxr-xr-xmod/like.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/mod/like.php b/mod/like.php
index 916faf230..f4fd33787 100755
--- a/mod/like.php
+++ b/mod/like.php
@@ -209,13 +209,17 @@ function like_content(&$a) {
}
else {
+ // this is used to like an item or comment
+
$item_id = ((argc() == 2) ? notags(trim(argv(1))) : 0);
logger('like: verb ' . $verb . ' item ' . $item_id, LOGGER_DEBUG);
+ // get the item. Allow linked photos (which are normally hidden) to be liked
- $r = q("SELECT * FROM item WHERE id = %d and item_restrict = 0 LIMIT 1",
- dbesc($item_id)
+ $r = q("SELECT * FROM item WHERE id = %d and (item_restrict = 0 or item_restrict = %d) LIMIT 1",
+ intval($item_id),
+ intval(ITEM_HIDDEN)
);
if(! $item_id || (! $r)) {
@@ -325,6 +329,15 @@ function like_content(&$a) {
if($item['item_flags'] & ITEM_WALL)
$item_flags |= ITEM_WALL;
+ // if this was a linked photo and was hidden, unhide it.
+
+ if($item['item_restrict'] & ITEM_HIDDEN) {
+ $r = q("update item set item_restrict = (item_restrict ^ %d) where id = %d limit 1",
+ intval(ITEM_HIDDEN),
+ intval($item['id'])
+ );
+ }
+
}
if($verb === 'like')