aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2017-11-24 22:48:15 +0100
committerMario Vavti <mario@mariovavti.com>2017-11-24 22:48:15 +0100
commitb03545f89939ef1c13ca7f5a950d52fcb7f2313f (patch)
treea5933ad0e4ce8f0bb9e19e4d66a8ec0172d93867 /Zotlabs
parent64c81ed17474cfa3dfe0e84475a49089c0af0106 (diff)
downloadvolse-hubzilla-b03545f89939ef1c13ca7f5a950d52fcb7f2313f.tar.gz
volse-hubzilla-b03545f89939ef1c13ca7f5a950d52fcb7f2313f.tar.bz2
volse-hubzilla-b03545f89939ef1c13ca7f5a950d52fcb7f2313f.zip
mod hq: minor query change
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Hq.php12
1 files changed, 2 insertions, 10 deletions
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 = [];
}