summaryrefslogtreecommitdiffstats
path: root/apps/comments/lib/Notification/Notifier.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/comments/lib/Notification/Notifier.php')
-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');
}