diff options
Diffstat (limited to 'lib/Controller/WorkspaceController.php')
-rw-r--r-- | lib/Controller/WorkspaceController.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Controller/WorkspaceController.php b/lib/Controller/WorkspaceController.php index 565cabe57..99658fc5a 100644 --- a/lib/Controller/WorkspaceController.php +++ b/lib/Controller/WorkspaceController.php @@ -56,6 +56,7 @@ use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\OCSController; use OCP\DirectEditing\IManager as IDirectEditingManager; use OCP\DirectEditing\RegisterDirectEditorEvent; +use OCP\EventDispatcher\IEventDispatcher; use OCP\Files\Folder; use OCP\Files\IRootFolder; use OCP\Files\NotFoundException; @@ -89,8 +90,10 @@ class WorkspaceController extends OCSController { 'Readme.md', 'readme.md' ]; + /** @var IEventDispatcher */ + private $eventDispatcher; - public function __construct($appName, IRequest $request, IRootFolder $rootFolder, IManager $shareManager, IDirectEditingManager $directEditingManager, IURLGenerator $urlGenerator, WorkspaceService $workspaceService, $userId) { + public function __construct($appName, IRequest $request, IRootFolder $rootFolder, IManager $shareManager, IDirectEditingManager $directEditingManager, IURLGenerator $urlGenerator, WorkspaceService $workspaceService, IEventDispatcher $eventDispatcher, $userId) { parent::__construct($appName, $request); $this->rootFolder = $rootFolder; $this->shareManager = $shareManager; @@ -98,6 +101,7 @@ class WorkspaceController extends OCSController { $this->userId = $userId; $this->directEditingManager = $directEditingManager; $this->urlGenerator = $urlGenerator; + $this->eventDispatcher = $eventDispatcher; } /** @@ -165,6 +169,8 @@ class WorkspaceController extends OCSController { * @NoAdminRequired */ public function direct(string $path): DataResponse { + $this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager)); + try { $folder = $this->rootFolder->getUserFolder($this->userId)->get($path); if ($folder instanceof Folder) { |