mirror of
https://github.com/friendica/friendica
synced 2025-04-23 18:30:11 +00:00
Move follow revoke protocol to worker task
- Switch to public contact for revoke_follow hook
This commit is contained in:
parent
6a1f9a7fa3
commit
cddead2343
5 changed files with 81 additions and 29 deletions
|
@ -38,7 +38,10 @@ use Psr\Log\LoggerInterface;
|
|||
|
||||
class Revoke extends BaseModule
|
||||
{
|
||||
/** @var array */
|
||||
/**
|
||||
* User-specific contact (uid != 0) array
|
||||
* @var array
|
||||
*/
|
||||
protected $contact;
|
||||
|
||||
/** @var Database */
|
||||
|
@ -82,14 +85,9 @@ class Revoke extends BaseModule
|
|||
|
||||
self::checkFormSecurityTokenRedirectOnError('contact/' . $this->parameters['id'], 'contact_revoke');
|
||||
|
||||
$result = Model\Contact::revokeFollow($this->contact);
|
||||
if ($result === true) {
|
||||
notice($this->t('Follow was successfully revoked.'));
|
||||
} elseif ($result === null) {
|
||||
notice($this->t('Follow was successfully revoked, however the remote contact won\'t be aware of this revokation.'));
|
||||
} else {
|
||||
notice($this->t('Unable to revoke follow, please try again later or contact the administrator.'));
|
||||
}
|
||||
Model\Contact::revokeFollow($this->contact);
|
||||
|
||||
notice($this->t('Follow was successfully revoked.'));
|
||||
|
||||
$this->baseUrl->redirect('contact/' . $this->parameters['id']);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue