diff options
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/AttributesTrait.php | 5 | ||||
| -rw-r--r-- | app/Models/Entry.php | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/app/Models/AttributesTrait.php b/app/Models/AttributesTrait.php index e94a973d9..8795d81d9 100644 --- a/app/Models/AttributesTrait.php +++ b/app/Models/AttributesTrait.php @@ -15,6 +15,11 @@ trait FreshRSS_AttributesTrait { return $this->attributes; } + /** @param non-empty-string $key */ + public function hasAttribute(string $key): bool { + return isset($this->attributes[$key]); + } + /** * @param non-empty-string $key * @return array<int|string,mixed>|null diff --git a/app/Models/Entry.php b/app/Models/Entry.php index ad480f3e6..3caa1ddb9 100644 --- a/app/Models/Entry.php +++ b/app/Models/Entry.php @@ -672,8 +672,7 @@ HTML; return; } if (!$this->isRead()) { - if ($feed->attributeBoolean('read_upon_reception') || - ($feed->attributeBoolean('read_upon_reception') === null && FreshRSS_Context::userConf()->mark_when['reception'])) { + if ($feed->attributeBoolean('read_upon_reception') ?? FreshRSS_Context::userConf()->mark_when['reception']) { $this->_isRead(true); Minz_ExtensionManager::callHook('entry_auto_read', $this, 'upon_reception'); } |
