Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/text.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Veyssier <eneiluj@posteo.net>2021-11-24 18:28:43 +0300
committerJulien Veyssier <eneiluj@posteo.net>2022-01-03 12:27:37 +0300
commitfc56680d9621a7fb8cc9fd75d0ad0230de3c9884 (patch)
treea41b8ee342afe11564d8472b981cb2b0c2ec92e4 /lib/Service/ApiService.php
parented48dcf16422933a54595e14190f2fddb0424081 (diff)
store file id (instead of name) in markdown image links, cleanup attachments when needed
Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
Diffstat (limited to 'lib/Service/ApiService.php')
-rw-r--r--lib/Service/ApiService.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Service/ApiService.php b/lib/Service/ApiService.php
index faa4c879e..e596f96cb 100644
--- a/lib/Service/ApiService.php
+++ b/lib/Service/ApiService.php
@@ -47,12 +47,18 @@ class ApiService {
protected $sessionService;
protected $documentService;
protected $logger;
+ private ImageService $imageService;
- public function __construct(IRequest $request, SessionService $sessionService, DocumentService $documentService, ILogger $logger) {
+ public function __construct(IRequest $request,
+ SessionService $sessionService,
+ DocumentService $documentService,
+ ImageService $imageService,
+ ILogger $logger) {
$this->request = $request;
$this->sessionService = $sessionService;
$this->documentService = $documentService;
$this->logger = $logger;
+ $this->imageService = $imageService;
}
public function create($fileId = null, $filePath = null, $token = null, $guestName = null, bool $forceRecreate = false): DataResponse {
@@ -127,6 +133,7 @@ class ApiService {
if (count($activeSessions) === 0) {
try {
$this->documentService->resetDocument($documentId);
+ $this->imageService->cleanupAttachments($documentId);
} catch (DocumentHasUnsavedChangesException $e) {
}
}