]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Contact/Profile.php
Removed redundant maximagesize = INF statements
[friendica.git] / src / Module / Contact / Profile.php
index f63821581223a4ce9c9b2554330f22a4f5e94b1e..eadc67818d506751551aa1fcae08200afd1c7b62 100644 (file)
@@ -34,7 +34,6 @@ use Friendica\Core\Hook;
 use Friendica\Core\L10n;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\Session;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
@@ -240,7 +239,7 @@ class Profile extends BaseModule
                }
 
                $url = Contact::magicLinkByContact($contact);
-               if (strpos($url, 'redir/') === 0) {
+               if (strpos($url, 'contact/redir/') === 0) {
                        $sparkle = ' class="sparkle" ';
                } else {
                        $sparkle = '';
@@ -286,7 +285,6 @@ class Profile extends BaseModule
                if ($contact['network'] == Protocol::FEED) {
                        $remote_self_options = [
                                Contact::MIRROR_DEACTIVATED => $this->t('No mirroring'),
-                               Contact::MIRROR_FORWARDED   => $this->t('Mirror as forwarded posting'),
                                Contact::MIRROR_OWN_POST    => $this->t('Mirror as my own posting')
                        ];
                } elseif ($contact['network'] == Protocol::ACTIVITYPUB) {
@@ -329,7 +327,7 @@ class Profile extends BaseModule
                        '$submit'                    => $this->t('Submit'),
                        '$lbl_info1'                 => $lbl_info1,
                        '$lbl_info2'                 => $this->t('Their personal note'),
-                       '$reason'                    => trim($contact['reason']),
+                       '$reason'                    => trim($contact['reason'] ?? ''),
                        '$infedit'                   => $this->t('Edit contact notes'),
                        '$common_link'               => 'contact/' . $contact['id'] . '/contacts/common',
                        '$relation_text'             => $relation_text,
@@ -416,6 +414,24 @@ class Profile extends BaseModule
 
                $formSecurityToken = self::getFormSecurityToken('contact_action');
 
+               if ($localRelationship->rel & Contact::SHARING) {
+                       $contact_actions['unfollow'] = [
+                               'label' => $this->t('Unfollow'),
+                               'url'   => 'contact/unfollow?url=' . urlencode($contact['url']) . '&auto=1',
+                               'title' => '',
+                               'sel'   => '',
+                               'id'    => 'unfollow',
+                       ];
+               } else {
+                       $contact_actions['follow'] = [
+                               'label' => $this->t('Follow'),
+                               'url'   => 'contact/follow?url=' . urlencode($contact['url']) . '&auto=1',
+                               'title' => '',
+                               'sel'   => '',
+                               'id'    => 'follow',
+                       ];
+               }
+
                // Provide friend suggestion only for Friendica contacts
                if ($contact['network'] === Protocol::DFRN) {
                        $contact_actions['suggest'] = [