mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 12:05:15 +02:00
Wrap item in INSERT_POST_LOCAL in separate array
This commit is contained in:
parent
59359f7d9d
commit
1ddd5674e1
5 changed files with 54 additions and 7 deletions
|
@ -112,7 +112,7 @@ final class HookEventBridge
|
|||
ArrayFilterEvent::FEATURE_ENABLED => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::FEATURE_GET => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL_START => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL => 'onInsertPostLocalEvent',
|
||||
ArrayFilterEvent::INSERT_POST_LOCAL_END => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::INSERT_POST_REMOTE => 'onArrayFilterEvent',
|
||||
ArrayFilterEvent::INSERT_POST_REMOTE_END => 'onArrayFilterEvent',
|
||||
|
@ -183,6 +183,20 @@ final class HookEventBridge
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map the INSERT_POST_LOCAL event to `post_local` hook
|
||||
*/
|
||||
public static function onInsertPostLocalEvent(ArrayFilterEvent $event): void
|
||||
{
|
||||
$data = $event->getArray();
|
||||
|
||||
$item = (array) $data['item'] ?? [];
|
||||
|
||||
$data['item'] = static::callHook($event->getName(), $item);
|
||||
|
||||
$event->setArray($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map the PREPARE_POST_START event to `prepare_body_init` hook
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue