summaryrefslogtreecommitdiffstats
path: root/controller
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-04-17 10:50:46 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-04-17 10:51:04 +0200
commit1fbcd35ac8f868e48228aafa375c5a305554a3c3 (patch)
treef3b40fa3e34f90774097bf78ceffc7f4527fa05b /controller
parent19b9456b6a96e8139d62a498fb31a96ed36fb442 (diff)
always return the unreadcount when marking read to set update request as 0, dont create new feeds that only consist of unreadcount updates
Diffstat (limited to 'controller')
-rw-r--r--controller/feedcontroller.php9
-rw-r--r--controller/itemcontroller.php11
2 files changed, 18 insertions, 2 deletions
diff --git a/controller/feedcontroller.php b/controller/feedcontroller.php
index 53257d73c..11cb60d5e 100644
--- a/controller/feedcontroller.php
+++ b/controller/feedcontroller.php
@@ -162,7 +162,14 @@ class FeedController extends Controller {
$feed = $this->feedBusinessLayer->update($feedId, $userId);
$params = array(
- 'feeds' => array($feed)
+ 'feeds' => array(
+ // only pass unreadcount to not accidentally readd
+ // the feed again
+ array(
+ 'id' => $feed->getId(),
+ 'unreadCount' => $feed->getUnreadCount()
+ )
+ )
);
return $this->renderJSON($params);
diff --git a/controller/itemcontroller.php b/controller/itemcontroller.php
index 5387f40a2..9081578ed 100644
--- a/controller/itemcontroller.php
+++ b/controller/itemcontroller.php
@@ -169,7 +169,16 @@ class ItemController extends Controller {
$highestItemId = (int) $this->params('highestItemId');
$this->itemBusinessLayer->readFeed($feedId, $highestItemId, $userId);
- return $this->renderJSON();
+
+ $params = array(
+ 'feeds' => array(
+ array(
+ 'id' => $feedId,
+ 'unreadCount' => 0
+ )
+ )
+ );
+ return $this->renderJSON($params);
}