From 6df5c0c6aebf83715846f18b87217f38fcae2761 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 9 Jan 2020 17:56:57 +0100 Subject: [PATCH] set error codes in CoAuthoring commands fixes #4 --- lib/Controller/CoAuthoringController.php | 7 +++++-- lib/Document/ConvertCommand.php | 6 ------ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/Controller/CoAuthoringController.php b/lib/Controller/CoAuthoringController.php index ce24f6c..23e24c1 100644 --- a/lib/Controller/CoAuthoringController.php +++ b/lib/Controller/CoAuthoringController.php @@ -21,6 +21,7 @@ namespace OCA\DocumentServer\Controller; +use OCA\DocumentServer\OnlyOffice\WebVersion; use OCP\AppFramework\Controller; class CoAuthoringController extends Controller { @@ -32,9 +33,11 @@ class CoAuthoringController extends Controller { public function command(string $c) { switch ($c) { case 'version': - return ['version' => 5.0]; + $webVersion = new WebVersion(); + + return ['version' => $webVersion->getWebUIVersion(), 'error' => 0]; default: - return []; + return ['error' => 5]; } } } diff --git a/lib/Document/ConvertCommand.php b/lib/Document/ConvertCommand.php index 3c2a6f5..d746753 100644 --- a/lib/Document/ConvertCommand.php +++ b/lib/Document/ConvertCommand.php @@ -29,8 +29,6 @@ class ConvertCommand implements XmlSerializable { private $isPDFA = null; /** @var bool|null */ private $fromChanges = null; - /** @var bool|null */ - private $isNoBase64 = null; /** @var int|null */ private $formatTo = null; /** @var string */ @@ -63,10 +61,6 @@ public function setFromChanges(bool $fromChanges): void { $this->fromChanges = $fromChanges; } - public function setIsNoBase64(bool $isNoBase64): void { - $this->isNoBase64 = $isNoBase64; - } - public function setTargetFormat(int $formatTo): void { $this->formatTo = $formatTo; }