mirror of
https://github.com/FreshRSS/FreshRSS.git
synced 2026-10-20 02:11:52 -04:00
Add hook entries_favorite (#6880)
Called when entries are starred or unstarred
This commit is contained in:
1 parent
256dcc21bb
commit
df763eb8b3
3 files changed
+7
No files matched your search
@@ -362,6 +362,7 @@ SQL;
|
||||
$values = array_merge($values, $ids);
|
||||
$stm = $this->pdo->prepare($sql);
|
||||
if ($stm !== false && $stm->execute($values)) {
|
||||
Minz_ExtensionManager::callHook('entries_favorite', $ids, $is_favorite);
|
||||
return $stm->rowCount();
|
||||
} else {
|
||||
$info = $stm === false ? $this->pdo->errorInfo() : $stm->errorInfo();
|
||||
|
||||
@@ -233,6 +233,8 @@ The following events are available:
|
||||
executed when a feed is refreshed and new entries will be imported into
|
||||
the database. The new entry (instance of FreshRSS\_Entry) will be passed
|
||||
as parameter.
|
||||
* `entries_favorite` (`function(array $ids, bool $is_favorite): void`):
|
||||
will be executed when some entries are marked or unmarked as favorites (starred)
|
||||
* `feed_before_actualize` (`function($feed) -> Feed | null`): will be
|
||||
executed when a feed is updated. The feed (instance of FreshRSS\_Feed)
|
||||
will be passed as parameter.
|
||||
|
||||
@@ -26,6 +26,10 @@ final class Minz_ExtensionManager {
|
||||
'list' => array(),
|
||||
'signature' => 'OneToOne',
|
||||
),
|
||||
'entries_favorite' => [ // function(array $ids, bool $is_favorite): void
|
||||
'list' => [],
|
||||
'signature' => 'PassArguments',
|
||||
],
|
||||
'entry_auto_read' => array( // function(FreshRSS_Entry $entry, string $why): void
|
||||
'list' => array(),
|
||||
'signature' => 'PassArguments',
|
||||
|
||||
Reference in new issue
Block a user