aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Like.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
committerMario <mario@mariovavti.com>2018-01-09 09:00:20 +0100
commit4f4d0e416eac87121898b8a27b1afa6065ff17a2 (patch)
treeaae7f2582b2b9c6596dcbf87c06a836434140830 /Zotlabs/Module/Like.php
parent22c89b6c660e185d5c5c6362acf23b145d932d15 (diff)
parent8fde0f01b8472082158b38386046ed606bcfbc49 (diff)
downloadvolse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.gz
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.tar.bz2
volse-hubzilla-4f4d0e416eac87121898b8a27b1afa6065ff17a2.zip
Merge branch '3.0RC'3.0
Diffstat (limited to 'Zotlabs/Module/Like.php')
-rw-r--r--Zotlabs/Module/Like.php26
1 files changed, 20 insertions, 6 deletions
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index b104a5f5f..b07824363 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -12,7 +12,10 @@ class Like extends \Zotlabs\Web\Controller {
function get() {
$o = '';
-
+
+ $sys_channel = get_sys_channel();
+ $sys_channel_id = (($sys_channel) ? $sys_channel['channel_id'] : 0);
+
$observer = \App::get_observer();
$interactive = $_REQUEST['interactive'];
if($interactive) {
@@ -253,20 +256,29 @@ class Like extends \Zotlabs\Web\Controller {
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_type = 0 or item_type = 6) and item_deleted = 0 and item_unpublished = 0
+ and item_type in (0,6,7) and item_deleted = 0 and item_unpublished = 0
and item_delayed = 0 and item_pending_remove = 0 and item_blocked = 0 LIMIT 1",
intval($item_id)
);
-
+
+ // if interacting with a pubstream item,
+ // create a copy of the parent in your stream. If not the conversation
+ // parent, copy that as well.
+
+ if($r) {
+ if($r[0]['uid'] === $sys_channel['channel_id'] && local_channel()) {
+ $r = [ copy_of_pubitem(\App::get_channel(), $r[0]['mid']) ];
+ }
+ }
+
if(! $item_id || (! $r)) {
logger('like: no item ' . $item_id);
killme();
}
-
- xchan_query($r,true,(($r[0]['uid'] == local_channel()) ? 0 : local_channel()));
+ xchan_query($r,true);
$item = $r[0];
@@ -464,6 +476,8 @@ class Like extends \Zotlabs\Web\Controller {
$arr['mid'] = $mid;
$arr['aid'] = (($extended_like) ? $ch[0]['channel_account_id'] : $owner_aid);
$arr['uid'] = $owner_uid;
+
+
$arr['item_flags'] = $item_flags;
$arr['item_wall'] = $item_wall;
$arr['parent_mid'] = (($extended_like) ? $mid : $item['mid']);