aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2017-07-29 12:24:03 +0200
committergit-marijus <mario@mariovavti.com>2017-07-29 12:24:03 +0200
commit5a1b850dd6510cd6ece5c1e49589510aa1782cf6 (patch)
treeec07647b7c46ba4535fb276c61fa495e9de11420 /Zotlabs
parentc4e0e20eb3304025695aa244d9efa739909a65dd (diff)
downloadvolse-hubzilla-5a1b850dd6510cd6ece5c1e49589510aa1782cf6.tar.gz
volse-hubzilla-5a1b850dd6510cd6ece5c1e49589510aa1782cf6.tar.bz2
volse-hubzilla-5a1b850dd6510cd6ece5c1e49589510aa1782cf6.zip
provide public stream notification also for not authenticated viewers
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Ping.php10
-rw-r--r--Zotlabs/Module/Pubstream.php1
2 files changed, 8 insertions, 3 deletions
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index ddb3a8c12..bf926075c 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -39,6 +39,9 @@ class Ping extends \Zotlabs\Web\Controller {
$result['pubs'] = 0;
$result['files'] = 0;
+ if(! $_SESSION['static_loadtime'])
+ $_SESSION['static_loadtime'] = datetime_convert();
+
$t0 = dba_timer();
header("content-type: application/json");
@@ -136,16 +139,19 @@ class Ping extends \Zotlabs\Web\Controller {
db_utcnow(), db_quoteinterval('3 MINUTE')
);
+ $notify_pubs = local_channel() ? ($vnotify & VNOTIFY_PUBS) && ! get_config('system', 'disable_discover_tab') : ! get_config('system', 'disable_discover_tab');
- if(($vnotify & VNOTIFY_PUBS) && ! get_config('system', 'disable_discover_tab')) {
+ if($notify_pubs) {
$sys = get_sys_channel();
$pubs = q("SELECT count(id) as total from item
WHERE uid = %d
+ AND author_xchan != '%s'
AND item_unseen = 1
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal",
- intval($sys['channel_id'])
+ intval($sys['channel_id']),
+ dbesc(get_observer_hash())
);
if($pubs)
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index fd19ca98e..d9054dc48 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -8,7 +8,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
function get($update = 0, $load = false) {
-
if($load)
$_SESSION['loadtime'] = datetime_convert();