]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Contact/Profile.php
Add support for Mastodon /authorize_interaction route
[friendica.git] / src / Module / Contact / Profile.php
index ec1c6b55bc6e17091278009701b967f92bab21b7..ecb25dd60701e33e95c356f83044274d21a7d39a 100644 (file)
@@ -239,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 = '';
@@ -415,6 +415,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'] = [