mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-12 05:34:25 +02:00
Add events for follow, revoke_follow, block and unblock hooks
This commit is contained in:
parent
4d96875656
commit
10e4f4bf36
6 changed files with 59 additions and 10 deletions
|
@ -187,7 +187,7 @@ class Protocol
|
|||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
||||
$hook_data = $eventDispatcher->dispatch(
|
||||
new ArrayFilterEvent(ArrayFilterEvent::PROTOCOL_SUPPORTS_FOLLOW, $hook_data),
|
||||
new ArrayFilterEvent(ArrayFilterEvent::UNFOLLOW_CONTACT, $hook_data),
|
||||
)->getArray();
|
||||
|
||||
return $hook_data['result'];
|
||||
|
@ -223,7 +223,12 @@ class Protocol
|
|||
'uid' => $owner['uid'],
|
||||
'result' => null,
|
||||
];
|
||||
Hook::callAll('revoke_follow', $hook_data);
|
||||
|
||||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
||||
$hook_data = $eventDispatcher->dispatch(
|
||||
new ArrayFilterEvent(ArrayFilterEvent::REVOKE_FOLLOW_CONTACT, $hook_data),
|
||||
)->getArray();
|
||||
|
||||
return $hook_data['result'];
|
||||
}
|
||||
|
@ -261,7 +266,12 @@ class Protocol
|
|||
'uid' => $uid,
|
||||
'result' => null,
|
||||
];
|
||||
Hook::callAll('block', $hook_data);
|
||||
|
||||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
||||
$hook_data = $eventDispatcher->dispatch(
|
||||
new ArrayFilterEvent(ArrayFilterEvent::BLOCK_CONTACT, $hook_data),
|
||||
)->getArray();
|
||||
|
||||
return $hook_data['result'];
|
||||
}
|
||||
|
@ -300,7 +310,12 @@ class Protocol
|
|||
'uid' => $uid,
|
||||
'result' => null,
|
||||
];
|
||||
Hook::callAll('unblock', $hook_data);
|
||||
|
||||
$eventDispatcher = DI::eventDispatcher();
|
||||
|
||||
$hook_data = $eventDispatcher->dispatch(
|
||||
new ArrayFilterEvent(ArrayFilterEvent::UNBLOCK_CONTACT, $hook_data),
|
||||
)->getArray();
|
||||
|
||||
return $hook_data['result'];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue