From 442680fbc3b084cdfb7f342de9e0f41d0de9651b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 5 Sep 2023 11:17:50 +0200 Subject: [PATCH] fix: fix note controller user id param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- lib/Controller/NotesController.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/Controller/NotesController.php b/lib/Controller/NotesController.php index cb946b73a..3aad4f9cb 100644 --- a/lib/Controller/NotesController.php +++ b/lib/Controller/NotesController.php @@ -28,7 +28,6 @@ class NotesController extends Controller { private IConfig $settings; private IL10N $l10n; private IMimeTypeDetector $mimeTypeDetector; - private string $userId; public function __construct( string $AppName, @@ -39,8 +38,7 @@ public function __construct( Helper $helper, IConfig $settings, IL10N $l10n, - IMimeTypeDetector $mimeTypeDetector, - string $userId + IMimeTypeDetector $mimeTypeDetector ) { parent::__construct($AppName, $request); $this->notesService = $notesService; @@ -50,7 +48,6 @@ public function __construct( $this->settings = $settings; $this->l10n = $l10n; $this->mimeTypeDetector = $mimeTypeDetector; - $this->userId = $userId; } /** @@ -350,11 +347,11 @@ public function uploadFile(int $noteid): JSONResponse { } private function inLockScope(Note $note, callable $callback) { - $isRichText = $this->settingsService->get($this->userId, 'noteMode') === 'rich'; + $isRichText = $this->settingsService->get($this->helper->getUID(), 'noteMode') === 'rich'; $lockContext = new LockContext( $note->getFile(), $isRichText ? ILock::TYPE_APP : ILock::TYPE_USER, - $isRichText ? 'text' : $this->userId + $isRichText ? 'text' : $this->helper->getUID() ); $this->lockManager->runInScope($lockContext, function () use ($callback) { $callback();