aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Controllers/feedController.php10
-rw-r--r--app/Models/Entry.php23
2 files changed, 24 insertions, 9 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 485851948..8c95a5c9c 100644
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -479,8 +479,16 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
//This entry already exists but has been updated
//Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->url(false) .
//', old hash ' . $existingHash . ', new hash ' . $entry->hash());
- $entry->_isRead($mark_updated_article_unread ? false : null); //Change is_read according to policy.
$entry->_isFavorite(null); // Do not change favourite state
+ $entry->_isRead($mark_updated_article_unread ? false : null); //Change is_read according to policy.
+ if ($mark_updated_article_unread) {
+ Minz_ExtensionManager::callHook('entry_auto_unread', $entry, 'updated_article');
+ }
+
+ $entry->applyFilterActions($titlesAsRead);
+ if ($readWhenSameTitleInFeed > 0) {
+ $titlesAsRead[$entry->title()] = true;
+ }
$entry = Minz_ExtensionManager::callHook('entry_before_insert', $entry);
if (!($entry instanceof FreshRSS_Entry)) {
diff --git a/app/Models/Entry.php b/app/Models/Entry.php
index 9e3e97d1a..86b3899d8 100644
--- a/app/Models/Entry.php
+++ b/app/Models/Entry.php
@@ -643,20 +643,27 @@ HTML;
/** @param array<string,bool> $titlesAsRead */
public function applyFilterActions(array $titlesAsRead = []): void {
if ($this->feed != null) {
- if ($this->feed->attributes('read_upon_reception') ||
- ($this->feed->attributes('read_upon_reception') === null && FreshRSS_Context::$user_conf->mark_when['reception'])) {
- $this->_isRead(true);
- }
- if (!empty($titlesAsRead[$this->title()])) {
- Minz_Log::debug('Mark title as read: ' . $this->title());
- $this->_isRead(true);
+ if (!$this->isRead()) {
+ if ($this->feed->attributes('read_upon_reception') ||
+ ($this->feed->attributes('read_upon_reception') === null && FreshRSS_Context::$user_conf->mark_when['reception'])) {
+ $this->_isRead(true);
+ Minz_ExtensionManager::callHook('entry_auto_read', $this, 'upon_reception');
+ }
+ if (!empty($titlesAsRead[$this->title()])) {
+ Minz_Log::debug('Mark title as read: ' . $this->title());
+ $this->_isRead(true);
+ Minz_ExtensionManager::callHook('entry_auto_read', $this, 'same_title_in_feed');
+ }
}
foreach ($this->feed->filterActions() as $filterAction) {
if ($this->matches($filterAction->booleanSearch())) {
foreach ($filterAction->actions() as $action) {
switch ($action) {
case 'read':
- $this->_isRead(true);
+ if (!$this->isRead()) {
+ $this->_isRead(true);
+ Minz_ExtensionManager::callHook('entry_auto_read', $this, 'filter');
+ }
break;
case 'star':
$this->_isFavorite(true);