From 87eaa6d8e5a5fece531a8ce191f8e89e90f673c2 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 24 Nov 2017 15:01:34 +0100 Subject: some more work on mod hq --- Zotlabs/Lib/ThreadStream.php | 4 ++++ Zotlabs/Module/Hq.php | 19 ++++++++++--------- Zotlabs/Module/Ping.php | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/ThreadStream.php b/Zotlabs/Lib/ThreadStream.php index 9eebb929c..bdd2e9657 100644 --- a/Zotlabs/Lib/ThreadStream.php +++ b/Zotlabs/Lib/ThreadStream.php @@ -54,6 +54,10 @@ class ThreadStream { $this->profile_owner = local_channel(); $this->writable = true; break; + case 'hq': + $this->profile_owner = local_channel(); + $this->writable = true; + break; case 'channel': $this->profile_owner = \App::$profile['profile_uid']; $this->writable = perm_is_allowed($this->profile_owner,$ob_hash,'post_comments'); diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php index 78087c0f9..2795b9086 100644 --- a/Zotlabs/Module/Hq.php +++ b/Zotlabs/Module/Hq.php @@ -61,6 +61,7 @@ class Hq extends \Zotlabs\Web\Controller { $item_hash = 'b64.' . base64url_encode($r[0]['mid']); } + if(strpos($item_hash,'b64.') === 0) $decoded = @base64url_decode(substr($item_hash,4)); if($decoded) @@ -91,7 +92,7 @@ class Hq extends \Zotlabs\Web\Controller { 'bang' => '', 'visitor' => true, 'profile_uid' => local_channel(), - 'return_path' => 'channel/' . $channel['channel_address'], + 'return_path' => 'hq', 'expanded' => true, 'editor_autocomplete' => true, 'bbco_autocomplete' => 'bbcode', @@ -133,6 +134,8 @@ class Hq extends \Zotlabs\Web\Controller { if(! $update && ! $load) { + nav_set_selected('HQ'); + $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 @@ -143,14 +146,14 @@ class Hq extends \Zotlabs\Web\Controller { if($decoded) $mid = 'b64.' . base64url_encode($mid); - $o .= '
' . "\r\n"; + $o .= '
' . "\r\n"; $o .= "\r\n"; \App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),[ '$baseurl' => z_root(), - '$pgtype' => 'display', - '$uid' => '0', + '$pgtype' => 'hq', + '$uid' => local_channel(), '$gid' => '0', '$cid' => '0', '$cmin' => '0', @@ -181,6 +184,7 @@ class Hq extends \Zotlabs\Web\Controller { } if($load) { + $r = null; $r = q("SELECT item.id as item_id from item @@ -198,6 +202,7 @@ class Hq extends \Zotlabs\Web\Controller { } elseif($update) { + $r = null; $r = q("SELECT item.parent AS item_id from item @@ -238,7 +243,7 @@ class Hq extends \Zotlabs\Web\Controller { $items = []; } - $o .= conversation($items, 'display', $update, 'client'); + $o .= conversation($items, 'hq', $update, 'client'); if($updateable) { $x = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 AND uid = %d and parent = %d ", @@ -249,10 +254,6 @@ class Hq extends \Zotlabs\Web\Controller { $o .= '
'; - if(($update && $load) && (! $items)) { - notice( t('Something went wrong.') . EOL ); - } - return $o; } diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php index 406e554d1..84f9d2a21 100644 --- a/Zotlabs/Module/Ping.php +++ b/Zotlabs/Module/Ping.php @@ -496,7 +496,7 @@ class Ping extends \Zotlabs\Web\Controller { $r = q("SELECT id, item_wall FROM item WHERE item_unseen = 1 and uid = %d $item_normal - AND author_xchan != '%s' $sql_extra ", + AND author_xchan != '%s'", intval(local_channel()), dbesc($ob_hash) ); -- cgit v1.2.3