diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2025-05-02 18:40:47 +0000 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2025-05-02 18:40:47 +0000 |
| commit | bc0da8edb699eec9fb6424bb5d8650ac48dca69d (patch) | |
| tree | 1433d63b437b719bca1f11f9b6a605352aac3677 /classes/RPC.php | |
| parent | 4ae17d0f1c956bfe392653ab847eb2e3da6f7bfc (diff) | |
| parent | 3098dc0a163b4b70105da2eae1237057ae97ccb1 (diff) | |
Merge branch 'marked-hook' into 'master'
add plugin hooks invoked when articles get un/marked or un/published
See merge request tt-rss/tt-rss!123
Diffstat (limited to 'classes/RPC.php')
| -rw-r--r-- | classes/RPC.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/classes/RPC.php b/classes/RPC.php index 031bef509..a4a48242e 100644 --- a/classes/RPC.php +++ b/classes/RPC.php @@ -69,6 +69,8 @@ class RPC extends Handler_Protected { $sth->execute([$mark, $id, $_SESSION['uid']]); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_MARK_TOGGLED, [$id]); + print json_encode(array("message" => "UPDATE_COUNTERS")); } @@ -95,6 +97,8 @@ class RPC extends Handler_Protected { $sth->execute([$pub, $id, $_SESSION['uid']]); + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISH_TOGGLED, [$id]); + print json_encode(array("message" => "UPDATE_COUNTERS")); } @@ -345,6 +349,8 @@ class RPC extends Handler_Protected { } $sth->execute([...$ids, $_SESSION['uid']]); + + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_MARK_TOGGLED, $ids); } /** @@ -369,6 +375,8 @@ class RPC extends Handler_Protected { } $sth->execute([...$ids, $_SESSION['uid']]); + + PluginHost::getInstance()->run_hooks(PluginHost::HOOK_ARTICLES_PUBLISH_TOGGLED, $ids); } function log(): void { |