Add follow/unfollow link to the contact actions menu

This commit is contained in:
Hypolite Petovan 2022-11-05 18:15:25 -04:00
parent ae5dde9f5e
commit d5b29b1c61
4 changed files with 25 additions and 1 deletions

View file

@ -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'] = [