]> git.mxchange.org Git - friendica.git/commitdiff
Remove VCard for owner in Profile\Photos module
authorHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 04:52:33 +0000 (23:52 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Mon, 19 Dec 2022 04:52:33 +0000 (23:52 -0500)
- Remove unused remote contact retrieval
- Remove contact list from aside for non-owner visitors

src/Module/Profile/Photos.php

index caf0d1601110e13a990a89c579e887877b44450c..77654744035dc2e6287b862f4c16c323e856f56b 100644 (file)
@@ -78,7 +78,7 @@ class Photos extends \Friendica\Module\BaseProfile
                $this->systemMessages = $systemMessages;
                $this->aclFormatter   = $aclFormatter;
 
-               $owner = Profile::load($this->app, $this->parameters['nickname'] ?? '');
+               $owner = Profile::load($this->app, $this->parameters['nickname'] ?? '', false);
                if (!$owner || $owner['account_removed'] || $owner['account_expired']) {
                        throw new HTTPException\NotFoundException($this->t('User not found.'));
                }
@@ -318,16 +318,8 @@ class Photos extends \Friendica\Module\BaseProfile
                $owner_uid = $this->owner['uid'];
                $is_owner  = $this->session->getLocalUserId() == $owner_uid;
 
-               $remote_contact = false;
-               if ($this->session->getRemoteContactID($owner_uid)) {
-                       $contact_id = $this->session->getRemoteContactID($owner_uid);
-
-                       $contact        = Contact::getContactForUser($contact_id, $owner_uid, ['blocked', 'pending']);
-                       $remote_contact = $contact && !$contact['blocked'] && !$contact['pending'];
-               }
-
                if ($this->owner['hidewall'] && !$this->session->isAuthenticated()) {
-                       $this->baseUrl->redirect('profile/' . $owner['nickname'] . '/restricted');
+                       $this->baseUrl->redirect('profile/' . $this->owner['nickname'] . '/restricted');
                }
 
                $this->session->set('photo_return', $this->args->getCommand());
@@ -412,6 +404,11 @@ class Photos extends \Friendica\Module\BaseProfile
                        ]);
                }
 
+               // Removing vCard for owner
+               if ($is_owner) {
+                       $this->page['aside'] = '';
+               }
+
                if (!empty($photo_albums_widget)) {
                        $this->page['aside'] .= $photo_albums_widget;
                }