Skip to content

Commit

Permalink
set error codes in CoAuthoring commands
Browse files Browse the repository at this point in the history
fixes #4
  • Loading branch information
icewind1991 committed Jan 9, 2020
1 parent 0515669 commit 6df5c0c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 5 additions & 2 deletions lib/Controller/CoAuthoringController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

namespace OCA\DocumentServer\Controller;

use OCA\DocumentServer\OnlyOffice\WebVersion;
use OCP\AppFramework\Controller;

class CoAuthoringController extends Controller {
Expand All @@ -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];
}
}
}
6 changes: 0 additions & 6 deletions lib/Document/ConvertCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 6df5c0c

Please sign in to comment.