Replace "suggestme" with "net-publish"

This commit is contained in:
Michael 2020-02-17 07:16:45 +00:00
parent 83297ab991
commit 1d3586623c
4 changed files with 6 additions and 21 deletions

View file

@ -43,8 +43,7 @@ function poco_init(App $a) {
$nickname = Strings::escapeTags(trim($a->argv[1]));
}
if (empty($nickname)) {
$c = q("SELECT * FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1");
if (!DBA::isResult($c)) {
if (!DBA::exists('profile', ['net-publish' => true])) {
throw new \Friendica\Network\HTTPException\ForbiddenException();
}
$system_mode = true;
@ -113,8 +112,7 @@ function poco_init(App $a) {
DBA::escape(Protocol::OSTATUS)
);
} elseif ($system_mode) {
$contacts = q("SELECT count(*) AS `total` FROM `contact` WHERE `self` = 1
AND `uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) ");
$totalResults = DBA::count('profile', ['net-publish' => true]);
} else {
$contacts = q("SELECT count(*) AS `total` FROM `contact` WHERE `uid` = %d AND `blocked` = 0 AND `pending` = 0 AND `hidden` = 0 AND `archive` = 0
AND (`success_update` >= `failure_update` OR `last-item` >= `failure_update`)
@ -126,9 +124,9 @@ function poco_init(App $a) {
DBA::escape(Protocol::STATUSNET)
);
}
if (DBA::isResult($contacts)) {
if (empty($totalResults) && DBA::isResult($contacts)) {
$totalResults = intval($contacts[0]['total']);
} else {
} elseif (empty($totalResults)) {
$totalResults = 0;
}
if (!empty($_GET['startIndex'])) {
@ -156,8 +154,8 @@ function poco_init(App $a) {
`profile`.`postal-code` AS `ppostalcode`, `profile`.`country-name` AS `pcountry`, `user`.`account-type`
FROM `contact` INNER JOIN `profile` ON `profile`.`uid` = `contact`.`uid`
INNER JOIN `user` ON `user`.`uid` = `contact`.`uid`
WHERE `self` = 1
AND `contact`.`uid` IN (SELECT `uid` FROM `pconfig` WHERE `cat` = 'system' AND `k` = 'suggestme' AND `v` = 1) LIMIT %d, %d",
WHERE `self` = 1 AND `profile`.`net-publish`
LIMIT %d, %d",
intval($startIndex),
intval($itemsPerPage)
);

View file

@ -495,7 +495,6 @@ function settings_post(App $a)
$blocktags = ((!empty($_POST['blocktags']) && (intval($_POST['blocktags']) == 1)) ? 0: 1); // this setting is inverted!
$unkmail = ((!empty($_POST['unkmail']) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
$cntunkmail = (!empty($_POST['cntunkmail']) ? intval($_POST['cntunkmail']) : 0);
$suggestme = (!empty($_POST['suggestme']) ? intval($_POST['suggestme']) : 0);
$hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
$hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
@ -593,8 +592,6 @@ function settings_post(App $a)
DI::pConfig()->set(local_user(), 'expire', 'photos', $expire_photos);
DI::pConfig()->set(local_user(), 'expire', 'network_only', $expire_network_only);
DI::pConfig()->set(local_user(), 'system', 'suggestme', $suggestme);
DI::pConfig()->set(local_user(), 'system', 'email_textonly', $email_textonly);
DI::pConfig()->set(local_user(), 'system', 'detailed_notif', $detailed_notif);
@ -1024,7 +1021,6 @@ function settings_content(App $a)
$expire_starred = DI::pConfig()->get(local_user(), 'expire', 'starred', true);
$expire_photos = DI::pConfig()->get(local_user(), 'expire', 'photos', false);
$expire_network_only = DI::pConfig()->get(local_user(), 'expire', 'network_only', false);
$suggestme = DI::pConfig()->get(local_user(), 'system', 'suggestme', false);
// nowarn_insecure
@ -1132,10 +1128,6 @@ function settings_content(App $a)
'$field' => ['blocktags', DI::l10n()->t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), DI::l10n()->t('Your contacts can add additional tags to your posts.')],
]);
$suggestme = Renderer::replaceMacros($opt_tpl, [
'$field' => ['suggestme', DI::l10n()->t('Allow us to suggest you as a potential friend to new members?'), $suggestme, DI::l10n()->t('If you like, Friendica may suggest new members to add you as a contact.')],
]);
$unkmail = Renderer::replaceMacros($opt_tpl, [
'$field' => ['unkmail', DI::l10n()->t('Permit unknown people to send you private mail?'), $unkmail, DI::l10n()->t('Friendica network users may send you private messages even if they are not in your contact list.')],
]);
@ -1219,7 +1211,6 @@ function settings_content(App $a)
'$permdesc' => DI::l10n()->t("\x28click to open/close\x29"),
'$visibility' => $profile['net-publish'],
'$aclselect' => ACL::getFullSelectorHTML(DI::page(), $a->user),
'$suggestme' => $suggestme,
'$blockwall'=> $blockwall, // array('blockwall', DI::l10n()->t('Allow friends to post to your profile page:'), !$blockwall, ''),
'$blocktags'=> $blocktags, // array('blocktags', DI::l10n()->t('Allow friends to tag your posts:'), !$blocktags, ''),

View file

@ -57,8 +57,6 @@
{{$blocktags nofilter}}
{{$suggestme nofilter}}
{{$unkmail nofilter}}
{{include file="field_input.tpl" field=$cntunkmail}}

View file

@ -93,8 +93,6 @@
{{$blocktags nofilter}}
{{$suggestme nofilter}}
{{$unkmail nofilter}}
{{include file="field_input.tpl" field=$cntunkmail}}