]> git.mxchange.org Git - friendica.git/commitdiff
Rename events to insert local post
authorArt4 <art4@wlabs.de>
Fri, 14 Mar 2025 15:45:36 +0000 (15:45 +0000)
committerArt4 <art4@wlabs.de>
Fri, 14 Mar 2025 15:45:36 +0000 (15:45 +0000)
mod/item.php
src/Content/Item.php
src/Core/Hooks/HookEventBridge.php
src/Event/ArrayFilterEvent.php
src/Model/Item.php
src/Module/Post/Tag/Add.php
tests/Unit/Core/Hooks/HookEventBridgeTest.php
tests/Unit/Event/ArrayFilterEventTest.php

index 46f2a219e3f8855ba77197d323b623caaa3011b7..e6b2cb93f4f947a5b5356f9561468f061f9a31a1 100644 (file)
@@ -46,7 +46,7 @@ function item_post()
        $eventDispatcher = DI::eventDispatcher();
 
        $_REQUEST = $eventDispatcher->dispatch(
-               new ArrayFilterEvent(ArrayFilterEvent::POST_LOCAL_START, $_REQUEST)
+               new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL_START, $_REQUEST)
        )->getArray();
 
        $return_path = $_REQUEST['return'] ?? '';
@@ -282,7 +282,7 @@ function item_process(array $post, array $request, bool $preview, string $return
        $eventDispatcher = DI::eventDispatcher();
 
        $post = $eventDispatcher->dispatch(
-               new ArrayFilterEvent(ArrayFilterEvent::POST_LOCAL, $post)
+               new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL, $post)
        )->getArray();
 
        unset($post['edit']);
index 9c9cd10bed16b1ad395d85369057e9352fe4754f..af26ebd8ed7eb3cb9d7e12fd50e339bb2b7e9026 100644 (file)
@@ -1012,7 +1012,7 @@ class Item
                }
 
                $post = $this->eventDispatcher->dispatch(
-                       new ArrayFilterEvent(ArrayFilterEvent::POST_LOCAL_END, $post)
+                       new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL_END, $post)
                )->getArray();
 
                $author = DBA::selectFirst('contact', ['thumb'], ['uid' => $post['uid'], 'self' => true]);
index 18a2754e33acc77728d70e8d2a41b35eca217e59..251c462929e20ef811e91c01a3b4924065e6a323 100644 (file)
@@ -43,9 +43,9 @@ final class HookEventBridge
                ArrayFilterEvent::NAV_INFO                        => 'nav_info',
                ArrayFilterEvent::FEATURE_ENABLED                 => 'isEnabled',
                ArrayFilterEvent::FEATURE_GET                     => 'get',
-               ArrayFilterEvent::POST_LOCAL_START                => 'post_local_start',
-               ArrayFilterEvent::POST_LOCAL                      => 'post_local',
-               ArrayFilterEvent::POST_LOCAL_END                  => 'post_local_end',
+               ArrayFilterEvent::INSERT_POST_LOCAL_START         => 'post_local_start',
+               ArrayFilterEvent::INSERT_POST_LOCAL               => 'post_local',
+               ArrayFilterEvent::INSERT_POST_LOCAL_END           => 'post_local_end',
                ArrayFilterEvent::INSERT_POST_REMOTE              => 'post_remote',
                ArrayFilterEvent::INSERT_POST_REMOTE_END          => 'post_remote_end',
                ArrayFilterEvent::PHOTO_UPLOAD_FORM               => 'photo_upload_form',
@@ -101,9 +101,9 @@ final class HookEventBridge
                        ArrayFilterEvent::NAV_INFO                        => 'onArrayFilterEvent',
                        ArrayFilterEvent::FEATURE_ENABLED                 => 'onArrayFilterEvent',
                        ArrayFilterEvent::FEATURE_GET                     => 'onArrayFilterEvent',
-                       ArrayFilterEvent::POST_LOCAL_START                => 'onArrayFilterEvent',
-                       ArrayFilterEvent::POST_LOCAL                      => 'onArrayFilterEvent',
-                       ArrayFilterEvent::POST_LOCAL_END                  => 'onArrayFilterEvent',
+                       ArrayFilterEvent::INSERT_POST_LOCAL_START         => 'onArrayFilterEvent',
+                       ArrayFilterEvent::INSERT_POST_LOCAL               => 'onArrayFilterEvent',
+                       ArrayFilterEvent::INSERT_POST_LOCAL_END           => 'onArrayFilterEvent',
                        ArrayFilterEvent::INSERT_POST_REMOTE              => 'onArrayFilterEvent',
                        ArrayFilterEvent::INSERT_POST_REMOTE_END          => 'onArrayFilterEvent',
                        ArrayFilterEvent::PHOTO_UPLOAD_FORM               => 'onArrayFilterEvent',
index 0ab06525bd31bbfed7ddd5438f47e8cfdf5e8235..51719e7de9e15d3654ad625545ad7360edde9e59 100644 (file)
@@ -24,11 +24,11 @@ final class ArrayFilterEvent extends Event
 
        public const FEATURE_GET = 'friendica.data.feature_get';
 
-       public const POST_LOCAL_START = 'friendica.data.post_local_start';
+       public const INSERT_POST_LOCAL_START = 'friendica.data.insert_post_local_start';
 
-       public const POST_LOCAL = 'friendica.data.post_local';
+       public const INSERT_POST_LOCAL = 'friendica.data.insert_post_local';
 
-       public const POST_LOCAL_END = 'friendica.data.post_local_end';
+       public const INSERT_POST_LOCAL_END = 'friendica.data.insert_post_local_end';
 
        public const INSERT_POST_REMOTE = 'friendica.data.insert_post_remote';
 
index 99ebba8cae319d3b3674ae880d918f6ca95cadc1..d2169d31569b2279a26e013d4ef86bef4eabe9c4 100644 (file)
@@ -847,7 +847,7 @@ class Item
                        }
 
                        $item = $eventDispatcher->dispatch(
-                               new ArrayFilterEvent(ArrayFilterEvent::POST_LOCAL, $item)
+                               new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL, $item)
                        )->getArray();
 
                        if ($dummy_session) {
index bf704a50c0fdd9307f230549a61e98b36fc2dc72..e03bf215a3f72d1b25eed920894f682d44296120 100644 (file)
@@ -154,7 +154,7 @@ EOT;
                $post['id'] = $post_id;
 
                $post = $this->eventDispatcher->dispatch(
-                       new ArrayFilterEvent(ArrayFilterEvent::POST_LOCAL_END, $post)
+                       new ArrayFilterEvent(ArrayFilterEvent::INSERT_POST_LOCAL_END, $post)
                )->getArray();
 
                $post = Post::selectFirst(['uri-id', 'uid'], ['id' => $post_id]);
index 69c49f35137bb7a7ba8a4b42d62f97bbdbd70867..325aefb7421aae3acabdeceabe154d9231ef390b 100644 (file)
@@ -32,9 +32,9 @@ class HookEventBridgeTest extends TestCase
                        ArrayFilterEvent::NAV_INFO                        => 'onArrayFilterEvent',
                        ArrayFilterEvent::FEATURE_ENABLED                 => 'onArrayFilterEvent',
                        ArrayFilterEvent::FEATURE_GET                     => 'onArrayFilterEvent',
-                       ArrayFilterEvent::POST_LOCAL_START                => 'onArrayFilterEvent',
-                       ArrayFilterEvent::POST_LOCAL                      => 'onArrayFilterEvent',
-                       ArrayFilterEvent::POST_LOCAL_END                  => 'onArrayFilterEvent',
+                       ArrayFilterEvent::INSERT_POST_LOCAL_START         => 'onArrayFilterEvent',
+                       ArrayFilterEvent::INSERT_POST_LOCAL               => 'onArrayFilterEvent',
+                       ArrayFilterEvent::INSERT_POST_LOCAL_END           => 'onArrayFilterEvent',
                        ArrayFilterEvent::INSERT_POST_REMOTE              => 'onArrayFilterEvent',
                        ArrayFilterEvent::INSERT_POST_REMOTE_END          => 'onArrayFilterEvent',
                        ArrayFilterEvent::PHOTO_UPLOAD_FORM               => 'onArrayFilterEvent',
@@ -313,9 +313,9 @@ class HookEventBridgeTest extends TestCase
                        [ArrayFilterEvent::NAV_INFO, 'nav_info'],
                        [ArrayFilterEvent::FEATURE_ENABLED, 'isEnabled'],
                        [ArrayFilterEvent::FEATURE_GET, 'get'],
-                       [ArrayFilterEvent::POST_LOCAL_START, 'post_local_start'],
-                       [ArrayFilterEvent::POST_LOCAL, 'post_local'],
-                       [ArrayFilterEvent::POST_LOCAL_END, 'post_local_end'],
+                       [ArrayFilterEvent::INSERT_POST_LOCAL_START, 'post_local_start'],
+                       [ArrayFilterEvent::INSERT_POST_LOCAL, 'post_local'],
+                       [ArrayFilterEvent::INSERT_POST_LOCAL_END, 'post_local_end'],
                        [ArrayFilterEvent::INSERT_POST_REMOTE, 'post_remote'],
                        [ArrayFilterEvent::INSERT_POST_REMOTE_END, 'post_remote_end'],
                        [ArrayFilterEvent::PHOTO_UPLOAD_FORM, 'photo_upload_form'],
index 193ccc77d8ac32b5da6b43c91ac7a7c7b1330171..7c124f0b33674dead288536627a57e9376c0e9ec 100644 (file)
@@ -29,9 +29,9 @@ class ArrayFilterEventTest extends TestCase
                        [ArrayFilterEvent::NAV_INFO, 'friendica.data.nav_info'],
                        [ArrayFilterEvent::FEATURE_ENABLED, 'friendica.data.feature_enabled'],
                        [ArrayFilterEvent::FEATURE_GET, 'friendica.data.feature_get'],
-                       [ArrayFilterEvent::POST_LOCAL_START, 'friendica.data.post_local_start'],
-                       [ArrayFilterEvent::POST_LOCAL, 'friendica.data.post_local'],
-                       [ArrayFilterEvent::POST_LOCAL_END, 'friendica.data.post_local_end'],
+                       [ArrayFilterEvent::INSERT_POST_LOCAL_START, 'friendica.data.insert_post_local_start'],
+                       [ArrayFilterEvent::INSERT_POST_LOCAL, 'friendica.data.insert_post_local'],
+                       [ArrayFilterEvent::INSERT_POST_LOCAL_END, 'friendica.data.insert_post_local_end'],
                        [ArrayFilterEvent::INSERT_POST_REMOTE, 'friendica.data.insert_post_remote'],
                        [ArrayFilterEvent::INSERT_POST_REMOTE_END, 'friendica.data.insert_post_remote_end'],
                        [ArrayFilterEvent::PHOTO_UPLOAD_FORM, 'friendica.data.photo_upload_form'],