consolidate disable_discover_tab config if it was not yet set to either 1 or 0 in DB
This commit is contained in:
parent
a618f70f56
commit
68b32cd8f4
@ -174,7 +174,8 @@ class Cron {
|
||||
|
||||
// pull in some public posts
|
||||
|
||||
if(! get_config('system','disable_discover_tab'))
|
||||
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
|
||||
if(! $disable_discover_tab)
|
||||
Master::Summon(array('Externals'));
|
||||
|
||||
$generation = 0;
|
||||
|
@ -409,8 +409,9 @@ class Network extends \Zotlabs\Web\Controller {
|
||||
}
|
||||
|
||||
$abook_uids = " and abook.abook_channel = " . local_channel() . " ";
|
||||
|
||||
if($firehose && (! get_config('system','disable_discover_tab'))) {
|
||||
|
||||
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
|
||||
if($firehose && (! $disable_discover_tab)) {
|
||||
require_once('include/channel.php');
|
||||
$sys = get_sys_channel();
|
||||
$uids = " and item.uid = " . intval($sys['channel_id']) . " ";
|
||||
|
@ -139,7 +139,8 @@ 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');
|
||||
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
|
||||
$notify_pubs = ((local_channel()) ? ($vnotify & VNOTIFY_PUBS) && !$disable_discover_tab : !$disable_discover_tab);
|
||||
|
||||
if($notify_pubs) {
|
||||
$sys = get_sys_channel();
|
||||
|
@ -16,8 +16,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
|
||||
return login();
|
||||
}
|
||||
|
||||
|
||||
if(get_config('system','disable_discover_tab'))
|
||||
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
|
||||
if($disable_discover_tab)
|
||||
return;
|
||||
|
||||
$item_normal = item_normal();
|
||||
|
@ -560,7 +560,7 @@ class Channel {
|
||||
'$vnotify10' => array('vnotify10', t('New connections'), ($vnotify & VNOTIFY_INTRO), VNOTIFY_INTRO, t('Recommended'), $yes_no),
|
||||
'$vnotify11' => array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, '', $yes_no),
|
||||
'$vnotify12' => array('vnotify12', t('Unseen shared files'), ($vnotify & VNOTIFY_FILES), VNOTIFY_FILES, '', $yes_no),
|
||||
'$vnotify13' => ((! get_config('system', 'disable_discover_tab')) ? array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no) : array()),
|
||||
'$vnotify13' => ((!get_config('system', 'disable_discover_tab')) ? array() : array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)),
|
||||
'$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
|
||||
|
||||
'$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')),
|
||||
|
@ -1624,11 +1624,9 @@ function network_tabs() {
|
||||
// tabs
|
||||
$tabs = array();
|
||||
|
||||
$d = get_config('system','disable_discover_tab');
|
||||
if($d === false)
|
||||
$d = 1;
|
||||
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
|
||||
|
||||
if(! $d) {
|
||||
if(! $disable_discover_tab) {
|
||||
$tabs[] = array(
|
||||
'label' => t('Discover'),
|
||||
'url' => z_root() . '/' . $cmd . '?f=&fh=1' ,
|
||||
|
@ -1344,8 +1344,10 @@ function public_recips($msg) {
|
||||
$include_sys = false;
|
||||
|
||||
if($msg['message']['type'] === 'activity') {
|
||||
if(! get_config('system','disable_discover_tab'))
|
||||
$disable_discover_tab = get_config('system','disable_discover_tab') || get_config('system','disable_discover_tab') === false;
|
||||
if(! $disable_discover_tab)
|
||||
$include_sys = true;
|
||||
|
||||
$perm = 'send_stream';
|
||||
|
||||
if(array_key_exists('flags',$msg['message']) && in_array('thread_parent', $msg['message']['flags'])) {
|
||||
|
Reference in New Issue
Block a user