-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(directediting): Allow opening by file id #36727
Conversation
if (!$this->directEditingManager->isEnabled()) { | ||
return new DataResponse(['message' => 'Direct editing is not enabled'], Http::STATUS_INTERNAL_SERVER_ERROR); | ||
} | ||
$this->eventDispatcher->dispatchTyped(new RegisterDirectEditorEvent($this->directEditingManager)); | ||
|
||
try { | ||
$token = $this->directEditingManager->open($path, $editorId); | ||
$token = $this->directEditingManager->open($path, $editorId, $fileId); |
Check notice
Code scanning / Psalm
UndefinedInterfaceMethod
6ff560a
to
6abf5d3
Compare
@juliushaertl any possibility to add a capability indicating whether this change is available? Otherwise I'll just check if server version >= 26 |
6abf5d3
to
7ff5b5a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
Maybe add a test? |
Signed-off-by: Julius Härtl <jus@bitgrid.net>
7ff5b5a
to
614981a
Compare
Pushed two further cases to cover the open method with and without a file id. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good to me.
Failure unrelated. |
@juliushaertl thanks |
@juliushaertl I have tested it, example: https://cloud.nextcloud.com/ocs/v2.php/apps/files/api/v1/directEditing/open?fileId=7155303&editorId=text |
You need to also provide |
Summary
Make sure that it is easy for the notes iOS/Android apps to open files by just knowing the file id. For cases where multiple files with the id are found we prefer the one with update permissions over others.
Checklist