From b03545f89939ef1c13ca7f5a950d52fcb7f2313f Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 Nov 2017 22:48:15 +0100 Subject: mod hq: minor query change --- Zotlabs/Module/Hq.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 2795b9086..08f4ddda5 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -43,10 +43,9 @@ class Hq extends \Zotlabs\Web\Controller { $item_normal_update = item_normal_update(); if(! $item_hash) { - $r = q("SELECT mid FROM item WHERE uid = %d - AND item_thread_top = 1 + AND mid = parent_mid ORDER BY created DESC limit 1", intval(local_channel()) @@ -64,13 +63,13 @@ class Hq extends \Zotlabs\Web\Controller { if(strpos($item_hash,'b64.') === 0) $decoded = @base64url_decode(substr($item_hash,4)); + if($decoded) $item_hash = $decoded; $updateable = false; if(! $update) { - $channel = \App::get_channel(); $channel_acl = [ @@ -139,7 +138,6 @@ class Hq extends \Zotlabs\Web\Controller { $static = ((local_channel()) ? channel_manual_conv_update(local_channel()) : 1); // if the target item is not a post (eg a like) we want to address its thread parent - $mid = ((($target_item['verb'] == ACTIVITY_LIKE) || ($target_item['verb'] == ACTIVITY_DISLIKE)) ? $target_item['thr_parent'] : $target_item['mid']); // if we got a decoded hash we must encode it again before handing to javascript @@ -180,11 +178,9 @@ class Hq extends \Zotlabs\Web\Controller { '$net' => '', '$mid' => $mid ]); - } if($load) { - $r = null; $r = q("SELECT item.id as item_id from item @@ -198,11 +194,8 @@ class Hq extends \Zotlabs\Web\Controller { if($r) { $updateable = true; } - } - elseif($update) { - $r = null; $r = q("SELECT item.parent AS item_id from item @@ -220,7 +213,6 @@ class Hq extends \Zotlabs\Web\Controller { $_SESSION['loadtime'] = datetime_convert(); } - else { $r = []; } -- cgit v1.2.3