Skip to content

Commit 442680f

Browse files
committed
fix: fix note controller user id param
Signed-off-by: Julius Härtl <[email protected]>
1 parent b735aa0 commit 442680f

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/Controller/NotesController.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ class NotesController extends Controller {
2828
private IConfig $settings;
2929
private IL10N $l10n;
3030
private IMimeTypeDetector $mimeTypeDetector;
31-
private string $userId;
3231

3332
public function __construct(
3433
string $AppName,
@@ -39,8 +38,7 @@ public function __construct(
3938
Helper $helper,
4039
IConfig $settings,
4140
IL10N $l10n,
42-
IMimeTypeDetector $mimeTypeDetector,
43-
string $userId
41+
IMimeTypeDetector $mimeTypeDetector
4442
) {
4543
parent::__construct($AppName, $request);
4644
$this->notesService = $notesService;
@@ -50,7 +48,6 @@ public function __construct(
5048
$this->settings = $settings;
5149
$this->l10n = $l10n;
5250
$this->mimeTypeDetector = $mimeTypeDetector;
53-
$this->userId = $userId;
5451
}
5552

5653
/**
@@ -350,11 +347,11 @@ public function uploadFile(int $noteid): JSONResponse {
350347
}
351348

352349
private function inLockScope(Note $note, callable $callback) {
353-
$isRichText = $this->settingsService->get($this->userId, 'noteMode') === 'rich';
350+
$isRichText = $this->settingsService->get($this->helper->getUID(), 'noteMode') === 'rich';
354351
$lockContext = new LockContext(
355352
$note->getFile(),
356353
$isRichText ? ILock::TYPE_APP : ILock::TYPE_USER,
357-
$isRichText ? 'text' : $this->userId
354+
$isRichText ? 'text' : $this->helper->getUID()
358355
);
359356
$this->lockManager->runInScope($lockContext, function () use ($callback) {
360357
$callback();

0 commit comments

Comments
 (0)