X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModule%2FContact%2FProfile.php;h=eadc67818d506751551aa1fcae08200afd1c7b62;hb=79235b6db1c9badd6c9602d54ad0d550e4bec2fd;hp=f63821581223a4ce9c9b2554330f22a4f5e94b1e;hpb=f609386ca11d805838f5526261068a69b489eab0;p=friendica.git diff --git a/src/Module/Contact/Profile.php b/src/Module/Contact/Profile.php index f638215812..eadc67818d 100644 --- a/src/Module/Contact/Profile.php +++ b/src/Module/Contact/Profile.php @@ -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'] = [