summaryrefslogtreecommitdiffstats
path: root/apps/comments/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-03-03 13:12:24 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-03-09 21:07:37 +0100
commitd4200a08cceeb99a41f45f50a41d50e0cb05cab3 (patch)
tree746cb973a5540aa7780499aeba8ed38020a5bc2d /apps/comments/lib
parent15fa306ae8b9dbf30a08ac50d0afbf3c8a46688f (diff)
downloadnextcloud-server-d4200a08cceeb99a41f45f50a41d50e0cb05cab3.tar.gz
nextcloud-server-d4200a08cceeb99a41f45f50a41d50e0cb05cab3.zip
Get the user folder of the correct user
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'apps/comments/lib')
-rw-r--r--apps/comments/lib/Notification/Notifier.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/apps/comments/lib/Notification/Notifier.php b/apps/comments/lib/Notification/Notifier.php
index a9daef3031f..09092da539c 100644
--- a/apps/comments/lib/Notification/Notifier.php
+++ b/apps/comments/lib/Notification/Notifier.php
@@ -23,7 +23,7 @@ namespace OCA\Comments\Notification;
use OCP\Comments\ICommentsManager;
use OCP\Comments\NotFoundException;
-use OCP\Files\Folder;
+use OCP\Files\IRootFolder;
use OCP\IURLGenerator;
use OCP\IUserManager;
use OCP\L10N\IFactory;
@@ -35,8 +35,8 @@ class Notifier implements INotifier {
/** @var IFactory */
protected $l10nFactory;
- /** @var Folder */
- protected $userFolder;
+ /** @var IRootFolder */
+ protected $rootFolder;
/** @var ICommentsManager */
protected $commentsManager;
@@ -49,13 +49,13 @@ class Notifier implements INotifier {
public function __construct(
IFactory $l10nFactory,
- Folder $userFolder,
+ IRootFolder $rootFolder,
ICommentsManager $commentsManager,
IURLGenerator $url,
IUserManager $userManager
) {
$this->l10nFactory = $l10nFactory;
- $this->userFolder = $userFolder;
+ $this->rootFolder = $rootFolder;
$this->commentsManager = $commentsManager;
$this->url = $url;
$this->userManager = $userManager;
@@ -93,7 +93,8 @@ class Notifier implements INotifier {
if($parameters[0] !== 'files') {
throw new \InvalidArgumentException('Unsupported comment object');
}
- $nodes = $this->userFolder->getById($parameters[1]);
+ $userFolder = $this->rootFolder->getUserFolder($notification->getUser());
+ $nodes = $userFolder->getById($parameters[1]);
if(empty($nodes)) {
throw new \InvalidArgumentException('Cannot resolve file id to Node instance');
}