summaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-06-03 13:35:38 +0200
committerGravatar GitHub <noreply@github.com> 2018-06-03 13:35:38 +0200
commitc0122003fe3031926546012b86a38b5187082613 (patch)
tree5502841327e7775f280fbd12732b4e8b8b7be6ff /app/Controllers/feedController.php
parent029f4107123f6c318584bf9a43da7118c318657f (diff)
parentbe778c6bc2d8075e5a923153183b47507a2a71e3 (diff)
Merge pull request #1902 from FreshRSS/dev1.11.0
FreshRSS 1.11.0
Diffstat (limited to 'app/Controllers/feedController.php')
-rwxr-xr-xapp/Controllers/feedController.php19
1 files changed, 12 insertions, 7 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index af732951f..ca85e7cb8 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -84,6 +84,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
'description' => $feed->description(),
'lastUpdate' => time(),
'httpAuth' => $feed->httpAuth(),
+ 'attributes' => array(),
);
$id = $feedDAO->addFeed($values);
@@ -271,7 +272,6 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$updated_feeds = 0;
$nb_new_articles = 0;
- $is_read = FreshRSS_Context::$user_conf->mark_when['reception'] ? 1 : 0;
foreach ($feeds as $feed) {
$url = $feed->url(); //For detection of HTTP 301
@@ -284,10 +284,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
$mtime = 0;
- $ttl = $feed->ttl();
- if ($ttl < FreshRSS_Feed::TTL_DEFAULT) {
+ if ($feed->mute()) {
continue; //Feed refresh is disabled
}
+ $ttl = $feed->ttl();
if ((!$simplePiePush) && (!$feed_id) &&
($feed->lastUpdate() + 10 >= time() - ($ttl == FreshRSS_Feed::TTL_DEFAULT ? FreshRSS_Context::$user_conf->ttl_default : $ttl))) {
//Too early to refresh from source, but check whether the feed was updated by another user
@@ -353,8 +353,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
} else { //This entry already exists but has been updated
//Minz_Log::debug('Entry with GUID `' . $entry->guid() . '` updated in feed ' . $feed->id() .
//', old hash ' . $existingHash . ', new hash ' . $entry->hash());
- //TODO: Make an updated/is_read policy by feed, in addition to the global one.
- $needFeedCacheRefresh = FreshRSS_Context::$user_conf->mark_updated_article_unread;
+ $mark_updated_article_unread = $feed->attributes('mark_updated_article_unread') !== null ? (
+ $feed->attributes('mark_updated_article_unread')
+ ) : FreshRSS_Context::$user_conf->mark_updated_article_unread;
+ $needFeedCacheRefresh = $mark_updated_article_unread;
$entry->_isRead(FreshRSS_Context::$user_conf->mark_updated_article_unread ? false : null); //Change is_read according to policy.
if (!$entryDAO->inTransaction()) {
$entryDAO->beginTransaction();
@@ -365,15 +367,18 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
// This entry should not be added considering configuration and date.
$oldGuids[] = $entry->guid();
} else {
+ $read_upon_reception = $feed->attributes('read_upon_reception') !== null ? (
+ $feed->attributes('read_upon_reception')
+ ) : FreshRSS_Context::$user_conf->mark_when['reception'];
if ($isNewFeed) {
$id = min(time(), $entry_date) . uSecString();
- $entry->_isRead($is_read);
+ $entry->_isRead($read_upon_reception);
} elseif ($entry_date < $date_min) {
$id = min(time(), $entry_date) . uSecString();
$entry->_isRead(true); //Old article that was not in database. Probably an error, so mark as read
} else {
$id = uTimeString();
- $entry->_isRead($is_read);
+ $entry->_isRead($read_upon_reception);
}
$entry->_id($id);