Add revoke follow feature

- Add new follow revoke module
- Add new hooks: revoke_follow, support_follow, support_revoke_follow
- Add link in contact page action menu
This commit is contained in:
Hypolite Petovan 2021-10-02 11:44:47 -04:00
parent 52b8cd054d
commit 72fae04e97
11 changed files with 272 additions and 16 deletions

View file

@ -1148,6 +1148,16 @@ class Contact extends BaseModule
];
if ($contact['uid'] != 0) {
if (Protocol::supportsRevokeFollow($contact['network']) && in_array($contact['rel'], [Model\Contact::FOLLOWER, Model\Contact::FRIEND])) {
$contact_actions['revoke_follow'] = [
'label' => DI::l10n()->t('Revoke Follow'),
'url' => 'contact/' . $contact['id'] . '/revoke',
'title' => DI::l10n()->t('Revoke the follow from this contact'),
'sel' => '',
'id' => 'revoke_follow',
];
}
$contact_actions['delete'] = [
'label' => DI::l10n()->t('Delete'),
'url' => 'contact/' . $contact['id'] . '/drop?t=' . $formSecurityToken,