]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Merge pull request #9146 from tobiasd/2020.09-CHANGELOG
[friendica.git] / src / Model / Contact.php
index 74ac1f68a54da30068d3e1c3cefbe439d4e2b4b7..3d3583b6bf70ad915ab80b1d7e817a27f7687b11 100644 (file)
@@ -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'];
                        }
                }
 
@@ -1911,7 +1909,7 @@ class Contact
                        $ret['pubkey'] = $new_pubkey;
                }
 
-               if (($ret['addr'] != $contact['addr']) || (!empty($ret['alias']) && ($ret['alias'] != $contact['alias']))) {
+               if ((!empty($ret['addr']) && ($ret['addr'] != $contact['addr'])) || (!empty($ret['alias']) && ($ret['alias'] != $contact['alias']))) {
                        $ret['uri-date'] = DateTimeFormat::utcNow();
                }
 
@@ -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])) {