summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-05-09 12:57:35 +0200
committerBernhard Posselt <nukeawhale@gmail.com>2013-05-09 12:57:35 +0200
commitb8b4dfb4969e1baf84a14fb65a5dc153b0f5fae4 (patch)
tree27e211e26f442efd72a7f34903953ad57b1a9b76 /external
parentfe0de2ab84a88cb4c742f4f10fd43716934b7282 (diff)
only make one request for mark all read and mark folder read, fix #171, fix a bug that prevented readding of feeds when its folder was deleted, fix a bug that would not allow mark read for feeds when the app was started for the first time
Diffstat (limited to 'external')
-rw-r--r--external/folderapi.php16
-rw-r--r--external/itemapi.php9
2 files changed, 24 insertions, 1 deletions
diff --git a/external/folderapi.php b/external/folderapi.php
index 642ca1968..879d62b5a 100644
--- a/external/folderapi.php
+++ b/external/folderapi.php
@@ -30,6 +30,7 @@ use \OCA\AppFramework\Controller\Controller;
use \OCA\AppFramework\Http\Request;
use \OCA\News\BusinessLayer\FolderBusinessLayer;
+use \OCA\News\BusinessLayer\ItemBusinessLayer;
use \OCA\News\BusinessLayer\BusinessLayerException;
use \OCA\News\BusinessLayer\BusinessLayerExistsException;
@@ -37,12 +38,15 @@ use \OCA\News\BusinessLayer\BusinessLayerExistsException;
class FolderAPI extends Controller {
private $folderBusinessLayer;
+ private $itemBusinessLayer;
public function __construct(API $api,
Request $request,
- FolderBusinessLayer $folderBusinessLayer){
+ FolderBusinessLayer $folderBusinessLayer,
+ ItemBusinessLayer $itemBusinessLayer){
parent::__construct($api, $request);
$this->folderBusinessLayer = $folderBusinessLayer;
+ $this->itemBusinessLayer = $itemBusinessLayer;
}
@@ -113,4 +117,14 @@ class FolderAPI extends Controller {
}
+ public function read() {
+ $userId = $this->api->getUserId();
+ $folderId = (int) $this->params('folderId');
+ $newestItemId = (int) $this->params('newestItemId');
+
+ $this->itemBusinessLayer->readFolder($folderId, $newestItemId, $userId);
+ return new NewsAPIResult();
+ }
+
+
}
diff --git a/external/itemapi.php b/external/itemapi.php
index 9699b4371..2ba1fcaed 100644
--- a/external/itemapi.php
+++ b/external/itemapi.php
@@ -147,4 +147,13 @@ class ItemAPI extends Controller {
}
+ public function readAll() {
+ $userId = $this->api->getUserId();
+ $newestItemId = (int) $this->params('newestItemId');
+
+ $this->itemBusinessLayer->readAll($newestItemId, $userId);
+ return new NewsAPIResult();
+ }
+
+
}