diff options
-rw-r--r-- | ajax/setallitemsread.php | 15 |
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 |