aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Pubstream.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-02-15 19:24:15 +0100
committerMario Vavti <mario@mariovavti.com>2018-02-15 19:24:15 +0100
commit9e251a1abcc50af0f678a17d3a688f4ba9e4a4fc (patch)
treecd58fb823f3b9019c2e69f533027eaedcd9cc208 /Zotlabs/Module/Pubstream.php
parent45b42cbc1c5356da61923f5bc2fbca1cec9f9119 (diff)
downloadvolse-hubzilla-9e251a1abcc50af0f678a17d3a688f4ba9e4a4fc.tar.gz
volse-hubzilla-9e251a1abcc50af0f678a17d3a688f4ba9e4a4fc.tar.bz2
volse-hubzilla-9e251a1abcc50af0f678a17d3a688f4ba9e4a4fc.zip
some more DB tuning.
Diffstat (limited to 'Zotlabs/Module/Pubstream.php')
-rw-r--r--Zotlabs/Module/Pubstream.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index afe53eca7..af7bc7658 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -166,7 +166,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
$net_query = (($net) ? " left join xchan on xchan_hash = author_xchan " : '');
$net_query2 = (($net) ? " and xchan_network = '" . protect_sprintf(dbesc($net)) . "' " : '');
-
+
+ $abook_uids = " and abook.abook_channel = " . intval(\App::$profile['profile_uid']) . " ";
$simple_update = (($_SESSION['loadtime']) ? " AND item.changed > '" . datetime_convert('UTC','UTC',$_SESSION['loadtime']) . "' " : '');
@@ -185,7 +186,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
if($load) {
if($mid) {
$r = q("SELECT parent AS item_id FROM item
- left join abook on item.author_xchan = abook.abook_xchan
+ left join abook on item.author_xchan = abook.abook_xchan
$net_query
WHERE mid like '%s' $uids $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
@@ -196,10 +197,9 @@ class Pubstream extends \Zotlabs\Web\Controller {
else {
// Fetch a page full of parent items for this page
$r = q("SELECT item.id AS item_id FROM item
- left join abook on item.author_xchan = abook.abook_xchan
+ left join abook on ( item.author_xchan = abook.abook_xchan $abook_uids )
$net_query
- WHERE item_thread_top = 1 $uids $item_normal
- AND item.parent = item.id
+ WHERE true $uids and item.item_thread_top = 1 $item_normal
and (abook.abook_blocked = 0 or abook.abook_flags is null)
$sql_extra3 $sql_extra $sql_nets $net_query2
ORDER BY $ordering DESC $pager_sql "