Simplifications

This commit is contained in:
Michael 2020-09-02 07:14:01 +00:00
parent 8402450101
commit 04b6f00ca9

View File

@ -1850,13 +1850,11 @@ class Contact
$ret['forum'] = false;
$ret['prv'] = false;
$ret['contact-type'] = $ret['account-type'];
if ($ret['contact-type'] == User::ACCOUNT_TYPE_COMMUNITY) {
if (isset($ret['manually-approve'])) {
if (($ret['contact-type'] == User::ACCOUNT_TYPE_COMMUNITY) && isset($ret['manually-approve'])) {
$ret['forum'] = (bool)!$ret['manually-approve'];
$ret['prv'] = (bool)!$ret['forum'];
}
}
}
$new_pubkey = $ret['pubkey'] ?? '';
@ -2121,11 +2119,9 @@ class Contact
$hidden = (($protocol === Protocol::MAIL) ? 1 : 0);
$pending = false;
if ($protocol == Protocol::ACTIVITYPUB) {
if (isset($ret['manually-approve'])) {
if (($protocol == Protocol::ACTIVITYPUB) && isset($ret['manually-approve'])) {
$pending = (bool)$ret['manually-approve'];
}
}
if (in_array($protocol, [Protocol::MAIL, Protocol::DIASPORA, Protocol::ACTIVITYPUB])) {
$writeable = 1;