Skip to content

Commit

Permalink
add nextcloud 28 support (#311)
Browse files Browse the repository at this point in the history
Signed-off-by: WhoAmI0501 <[email protected]>
  • Loading branch information
WhoAmI0501 authored Feb 5, 2024
1 parent e2e9ac8 commit b13e4f6
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Additionally, the community document server only supports running on x86-64 Linu
<screenshot>https://raw.githubusercontent.com/nextcloud/documentserver_community/master/screenshots/main.png</screenshot>
<screenshot>https://raw.githubusercontent.com/nextcloud/documentserver_community/master/screenshots/new.png</screenshot>
<dependencies>
<nextcloud min-version="21" max-version="27"/>
<nextcloud min-version="21" max-version="28"/>
</dependencies>

<background-jobs>
Expand Down
2 changes: 0 additions & 2 deletions lib/Controller/StaticController.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ public function webApps(string $path) {
$rawContent = file_get_contents($localPath);
$content = str_replace('__HINT__', addcslashes($hint, "'"), $rawContent);
return $this->createFileResponseWithContent($localPath, $content, false);
} elseif ($this->sessionManager->getSessionCount() >= 20) {
$localPath = __DIR__ . '/../../js/sessionlimit.js';
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/FileResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct($data, int $length, int $lastModified, string $mimeT
$this->data = $data;
$this->name = $name;
$this->setStatus($statusCode);
$this->setHeaders(array_merge($this->getHeaders(), $headers));
$this->setHeaders($headers);
$this->addHeader('Content-Length', $length);
$this->addHeader('Content-Type', $mimeType);

Expand Down
11 changes: 0 additions & 11 deletions lib/XHRCommand/AuthCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@
use OCA\DocumentServer\OnlyOffice\WebVersion;

class AuthCommand implements ICommandHandler {
public const MAX_CONNECTIONS = 20;

private $changeStore;
private $sessionManager;
private $lockStore;
Expand Down Expand Up @@ -75,15 +73,6 @@ public function handle(array $command, Session $session, IIPCChannel $sessionCha

$participants = $this->sessionManager->getSessionsForDocument($session->getDocumentId());

if (count($participants) > self::MAX_CONNECTIONS) {
$sessionChannel->pushMessage(json_encode([
'type' => 'auth',
'result' => 0,
]));

return;
}

$sessionChannel->pushMessage(json_encode([
'type' => 'auth',
'result' => 1,
Expand Down
2 changes: 1 addition & 1 deletion lib/XHRResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function __construct(
$this->type = $type;
$this->data = $data;
$this->setStatus($statusCode);
$this->setHeaders(array_merge($this->getHeaders(), $headers));
$this->setHeaders($headers);

$this->addHeader('Content-Type', 'application/javascript; charset=UTF-8');
}
Expand Down

0 comments on commit b13e4f6

Please sign in to comment.