]> git.mxchange.org Git - friendica.git/commitdiff
Replace $contact with $profile_contact in sidebar function.
authorvery-ape <git@verya.pe>
Sat, 22 May 2021 22:30:46 +0000 (15:30 -0700)
committervery-ape <git@verya.pe>
Sat, 22 May 2021 22:30:46 +0000 (15:30 -0700)
src/Model/Profile.php

index e883078f0d2074f65c0ff8e89d2436aba16f09ca..4ce5cfcca311f4b9b64e55a092183451e5089fbd 100644 (file)
@@ -268,13 +268,13 @@ class Profile
                // contact ID for the user viewing this page. Use 'nurl' to look up the
                // correct contact table entry for the logged-in user.
                $is_contact = !empty($profile['nurl']);
-               $contact = [];
+               $profile_contact = [];
 
                if ($is_contact) {
                        if (local_user() && ($profile['uid'] ?? '') != local_user()) {
-                               $contact = Contact::getById(Contact::getIdForURL($profile['nurl'], local_user()));
+                               $profile_contact = Contact::getById(Contact::getIdForURL($profile['nurl'], local_user()));
                        } else {
-                               $contact = $profile;
+                               $profile_contact = $profile;
                        }
                }
 
@@ -310,12 +310,6 @@ class Profile
                        $visitor_contact = Contact::selectFirst(['rel'], ['uid' => $profile['uid'], 'nurl' => Strings::normaliseLink(self::getMyURL())]);
                }
 
-               // Who is this profile to the logged-in user?
-               $profile_contact = [];
-               if (!empty($contact) && self::getMyURL()) {
-                       $profile_contact = $contact['rel'];
-               }
-
                $profile_is_dfrn = $profile['network'] == Protocol::DFRN;
                $profile_is_native = in_array($profile['network'], Protocol::NATIVE_SUPPORT);
                $local_user_is_self = self::getMyURL() && ($profile['url'] == self::getMyURL());
@@ -346,9 +340,9 @@ class Profile
                                $subscribe_feed_link = 'dfrn_poll/' . $profile['nickname'];
                        }
 
-                       if (Contact::canReceivePrivateMessages($contact)) {
+                       if (Contact::canReceivePrivateMessages($profile_contact)) {
                                if ($visitor_is_followed || $visitor_is_following) {
-                                       $wallmessage_link = $visitor_base_path . '/message/new/' . $contact['id'];
+                                       $wallmessage_link = $visitor_base_path . '/message/new/' . $profile_contact['id'];
                                } elseif ($visitor_is_authenticated && !empty($profile['unkmail'])) {
                                        $wallmessage_link = 'wallmessage/' . $profile['nickname'];
                                }