From 71c206fdb9d8ccdd0b65feb49db93a58ea51e0e6 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 7 Oct 2017 16:40:43 +0200 Subject: pubstream single view fixes --- Zotlabs/Module/Pubstream.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php index 4583f912b..15e2d8a74 100644 --- a/Zotlabs/Module/Pubstream.php +++ b/Zotlabs/Module/Pubstream.php @@ -22,13 +22,18 @@ class Pubstream extends \Zotlabs\Web\Controller { $mid = ((x($_REQUEST,'mid')) ? $_REQUEST['mid'] : ''); + if(strpos($mid,'b64.') === 0) + $decoded = @base64url_decode(substr($mid,4)); + if($decoded) + $mid = $decoded; + $item_normal = item_normal(); $item_normal_update = item_normal_update(); $static = ((array_key_exists('static',$_REQUEST)) ? intval($_REQUEST['static']) : 0); - if(! $update) { + if(! $update && !$load) { nav_set_selected(t('Public Stream')); @@ -46,6 +51,10 @@ class Pubstream extends \Zotlabs\Web\Controller { . "; var profile_page = " . \App::$pager['page'] . "; divmore_height = " . intval($maxheight) . "; \r\n"; + //if we got a decoded hash we must encode it again before handing to javascript + if($decoded) + $mid = 'b64.' . base64url_encode($mid); + \App::$page['htmlhead'] .= replace_macros(get_markup_template("build_query.tpl"),array( '$baseurl' => z_root(), '$pgtype' => 'pubstream', @@ -127,7 +136,7 @@ class Pubstream extends \Zotlabs\Web\Controller { left join abook on item.author_xchan = abook.abook_xchan WHERE mid like '%s' $uids $item_normal and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets", + $sql_extra3 $sql_extra $sql_nets LIMIT 1", dbesc($mid . '%') ); } @@ -149,7 +158,7 @@ class Pubstream extends \Zotlabs\Web\Controller { left join abook on item.author_xchan = abook.abook_xchan WHERE mid like '%s' $uids $item_normal_update $simple_update and (abook.abook_blocked = 0 or abook.abook_flags is null) - $sql_extra3 $sql_extra $sql_nets", + $sql_extra3 $sql_extra $sql_nets LIMIT 1", dbesc($mid . '%') ); } @@ -193,6 +202,9 @@ class Pubstream extends \Zotlabs\Web\Controller { $mode = ('network'); $o .= conversation($items,$mode,$update,$page_mode); + + if($mid) + $o .= '
'; if(($items) && (! $update)) $o .= alt_pager($a,count($items)); -- cgit v1.2.3