summaryrefslogtreecommitdiffstats
path: root/ajax
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2012-08-16 23:32:58 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2012-08-16 23:32:58 +0200
commit3ab2ba7c5c12f5507301f6049ba0b6c437cf25f0 (patch)
tree2edf5f1ce77b52127c986fadfdc724bba598c689 /ajax
parent296cad3a05bd9c5693ad936c90ab3ebfc15b7665 (diff)
mark all read now works in new articles and starred view
Diffstat (limited to 'ajax')
-rw-r--r--ajax/setallitemsread.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/ajax/setallitemsread.php b/ajax/setallitemsread.php
index b5fca1fd3..d352b2aa3 100644
--- a/ajax/setallitemsread.php
+++ b/ajax/setallitemsread.php
@@ -21,7 +21,20 @@ $mostRecentItemId = (int)$_POST['mostRecentItemId'];
$itemMapper = new OCA\News\ItemMapper();
$mostRecentItem = $itemMapper->find($mostRecentItemId);
//echo $mostRecentItem->getDate();
-$items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD);
+switch ($feedId) {
+ case -2:
+ $items = $itemMapper->findEveryItemByStatus(OCA\News\StatusFlag::UNREAD);
+ break;
+
+ case -1:
+ $items = $itemMapper->findEveryItemByStatus(OCA\News\StatusFlag::UNREAD | OCA\News\StatusFlag::IMPORTANT);
+ break;
+
+ default:
+ $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD);
+ break;
+}
+
// FIXME: maybe there is a way to set all items read in the
// FeedMapper instead of iterating through every item and updating as