]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Profile.php
Merge remote-tracking branch 'upstream/develop' into contact-update
[friendica.git] / src / Model / Profile.php
index f78edb5bd071408b9836e9b45d1eeac422c7d65f..10bd3a1d7542843aaad239c512c4e892bba45b80 100644 (file)
@@ -117,6 +117,11 @@ class Profile
                }
 
                if (count($profiledata) > 0) {
+                       // Ensure to have a "nickname" field
+                       if (empty($profiledata['nickname']) && !empty($profiledata['nick'])) {
+                               $profiledata['nickname'] = $profiledata['nick'];
+                       }
+
                        // Add profile data to sidebar
                        $a->page['aside'] .= self::sidebar($a, $profiledata, true, $show_connect);
 
@@ -317,12 +322,12 @@ class Profile
 
 
                $visitor_contact = [];
-               if ($profile['uid'] && self::getMyURL()) {
+               if (!empty($profile['uid']) && self::getMyURL()) {
                        $visitor_contact = Contact::selectFirst(['rel'], ['uid' => $profile['uid'], 'nurl' => Strings::normaliseLink(self::getMyURL())]);
                }
 
                $profile_contact = [];
-               if ($profile['cid'] && self::getMyURL()) {
+               if (!empty($profile['cid']) && self::getMyURL()) {
                        $profile_contact = Contact::selectFirst(['rel'], ['id' => $profile['cid']]);
                }
 
@@ -338,7 +343,7 @@ class Profile
                        || in_array($profile_contact['rel'] ?? 0, [Contact::FOLLOWER, Contact::FRIEND]);
                $visitor_base_path = self::getMyURL() ? preg_replace('=/profile/(.*)=ism', '', self::getMyURL()) : '';
 
-               if (!$local_user_is_self) {
+               if (!$local_user_is_self && $show_connect) {
                        if (!$visitor_is_authenticated) {
                                $follow_link = 'dfrn_request/' . $profile['nickname'];
                        } elseif ($profile_is_native) {
@@ -466,7 +471,7 @@ class Profile
                                        'pending' => false,
                                        'hidden' => false,
                                        'archive' => false,
-                                       'network' => [Protocol::DFRN, Protocol::ACTIVITYPUB, Protocol::OSTATUS, Protocol::DIASPORA],
+                                       'network' => Protocol::FEDERATED,
                                ]);
                        }
                }