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;
}
$url = Contact::magicLinkByContact($contact);
- if (strpos($url, 'redir/') === 0) {
+ if (strpos($url, 'contact/redir/') === 0) {
$sparkle = ' class="sparkle" ';
} else {
$sparkle = '';
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) {
'$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,
$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'] = [