summaryrefslogtreecommitdiffstats
path: root/db/feedmapper.php
diff options
context:
space:
mode:
Diffstat (limited to 'db/feedmapper.php')
-rw-r--r--db/feedmapper.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/db/feedmapper.php b/db/feedmapper.php
index ba47d0a8a..108494613 100644
--- a/db/feedmapper.php
+++ b/db/feedmapper.php
@@ -135,8 +135,10 @@ class FeedMapper extends Mapper implements IMapper {
public function deleteReadOlderThanId($id){
- $sql = 'DELETE FROM `*PREFIX*news_items` WHERE `id` < ?';
- $params = array($id);
+ $status = StatusFlag::STARRED | StatusFlag::UNREAD;
+ $sql = 'DELETE FROM `*PREFIX*news_items` WHERE `id` < ? ' .
+ 'AND NOT ((`status` & ?) > 0)';
+ $params = array($id, $status);
$this->execute($sql, $params);
}