Merge pull request #8331 from MrPetovan/task/expand-no_auto_update

Expand system.no_auto_update to community, profile statuses and contact conversations pages
This commit is contained in:
Michael Vogel 2020-02-24 07:25:17 +01:00 committed by GitHub
commit 9b75f5d6aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 5 deletions

View file

@ -28,7 +28,7 @@ use Friendica\Module\Contact;
function update_contact_content(App $a) function update_contact_content(App $a)
{ {
if ($_GET["force"] == 1) { if (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update')) {
$text = Contact::content([], true); $text = Contact::content([], true);
} else { } else {
$text = ''; $text = '';

View file

@ -197,7 +197,7 @@ class Display extends BaseSettings
'$itemspage_network' => ['itemspage_network' , DI::l10n()->t('Number of items to display per page:'), $itemspage_network, DI::l10n()->t('Maximum of 100 items')], '$itemspage_network' => ['itemspage_network' , DI::l10n()->t('Number of items to display per page:'), $itemspage_network, DI::l10n()->t('Maximum of 100 items')],
'$itemspage_mobile_network' => ['itemspage_mobile_network', DI::l10n()->t('Number of items to display per page when viewed from mobile device:'), $itemspage_mobile_network, DI::l10n()->t('Maximum of 100 items')], '$itemspage_mobile_network' => ['itemspage_mobile_network', DI::l10n()->t('Number of items to display per page when viewed from mobile device:'), $itemspage_mobile_network, DI::l10n()->t('Maximum of 100 items')],
'$ajaxint' => ['browser_update' , DI::l10n()->t('Update browser every xx seconds'), $browser_update, DI::l10n()->t('Minimum of 10 seconds. Enter -1 to disable it.')], '$ajaxint' => ['browser_update' , DI::l10n()->t('Update browser every xx seconds'), $browser_update, DI::l10n()->t('Minimum of 10 seconds. Enter -1 to disable it.')],
'$no_auto_update' => ['no_auto_update' , DI::l10n()->t('Automatic updates only at the top of the network page'), $no_auto_update, DI::l10n()->t('When disabled, the network page is updated all the time, which could be confusing while reading.')], '$no_auto_update' => ['no_auto_update' , DI::l10n()->t('Automatic updates only at the top of the post stream pages'), $no_auto_update, DI::l10n()->t('Auto update may add new posts at the top of the post stream pages, which can affect the scroll position and perturb normal reading if it happens anywhere else the top of the page.')],
'$nosmile' => ['nosmile' , DI::l10n()->t('Don\'t show emoticons'), $nosmile, DI::l10n()->t('Normally emoticons are replaced with matching symbols. This setting disables this behaviour.')], '$nosmile' => ['nosmile' , DI::l10n()->t('Don\'t show emoticons'), $nosmile, DI::l10n()->t('Normally emoticons are replaced with matching symbols. This setting disables this behaviour.')],
'$infinite_scroll' => ['infinite_scroll' , DI::l10n()->t('Infinite scroll'), $infinite_scroll, DI::l10n()->t('Automatic fetch new items when reaching the page end.')], '$infinite_scroll' => ['infinite_scroll' , DI::l10n()->t('Infinite scroll'), $infinite_scroll, DI::l10n()->t('Automatic fetch new items when reaching the page end.')],
'$no_smart_threading' => ['no_smart_threading' , DI::l10n()->t('Disable Smart Threading'), $no_smart_threading, DI::l10n()->t('Disable the automatic suppression of extraneous thread indentation.')], '$no_smart_threading' => ['no_smart_threading' , DI::l10n()->t('Disable Smart Threading'), $no_smart_threading, DI::l10n()->t('Disable the automatic suppression of extraneous thread indentation.')],

View file

@ -37,7 +37,10 @@ class Community extends CommunityModule
{ {
self::parseRequest($parameters); self::parseRequest($parameters);
$o = conversation(DI::app(), self::getItems(), 'community', true, false, 'commented', local_user()); $o = '';
if (!empty($_GET['force']) || !DI::pConfig()->get(local_user(), 'system', 'no_auto_update')) {
$o = conversation(DI::app(), self::getItems(), 'community', true, false, 'commented', local_user());
}
System::htmlUpdateExit($o); System::htmlUpdateExit($o);
} }

View file

@ -42,8 +42,6 @@ class Profile extends BaseModule
throw new ForbiddenException(); throw new ForbiddenException();
} }
$o = '';
$profile_uid = intval($_GET['p'] ?? 0); $profile_uid = intval($_GET['p'] ?? 0);
// Ensure we've got a profile owner if updating. // Ensure we've got a profile owner if updating.
@ -57,6 +55,12 @@ class Profile extends BaseModule
throw new ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.')); throw new ForbiddenException(DI::l10n()->t('Access to this profile has been restricted.'));
} }
$o = '';
if (empty($_GET['force']) && DI::pConfig()->get(local_user(), 'system', 'no_auto_update')) {
System::htmlUpdateExit($o);
}
// Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups // Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
$sql_extra = Item::getPermissionsSQLByUserId($a->profile['uid']); $sql_extra = Item::getPermissionsSQLByUserId($a->profile['uid']);