From 04b6f00ca99af70ded8b4424c00a49b8060a7837 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 2 Sep 2020 07:14:01 +0000 Subject: [PATCH] Simplifications --- src/Model/Contact.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 74ac1f68a..97c281e1a 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -1850,11 +1850,9 @@ 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'])) { - $ret['forum'] = (bool)!$ret['manually-approve']; - $ret['prv'] = (bool)!$ret['forum']; - } + if (($ret['contact-type'] == User::ACCOUNT_TYPE_COMMUNITY) && isset($ret['manually-approve'])) { + $ret['forum'] = (bool)!$ret['manually-approve']; + $ret['prv'] = (bool)!$ret['forum']; } } @@ -2121,10 +2119,8 @@ class Contact $hidden = (($protocol === Protocol::MAIL) ? 1 : 0); $pending = false; - if ($protocol == Protocol::ACTIVITYPUB) { - if (isset($ret['manually-approve'])) { - $pending = (bool)$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])) {