Skip to content

Commit

Permalink
Expose the app version to the capabilities endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibautPlg committed Mar 14, 2024
1 parent fe5f273 commit b430c46
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/AppInfo/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
use OCP\Capabilities\ICapability;
use OCP\IUser;
use OCP\IUserSession;
use OCP\App\IAppManager;

class Capabilities implements ICapability {
private IUserSession $userSession;
private FolderManager $folderManager;
private IAppManager $appManager;

public function __construct(IUserSession $userSession, FolderManager $folderManager) {
public function __construct(IUserSession $userSession, FolderManager $folderManager, IAppManager $appManager) {
$this->userSession = $userSession;
$this->folderManager = $folderManager;
$this->appManager = $appManager;
}

public function getCapabilities(): array {
Expand All @@ -25,6 +28,7 @@ public function getCapabilities(): array {
}
return [
Application::APP_ID => [
'appVersion' => $this->appManager->getAppVersion(Application::APP_ID),
'hasGroupFolders' => $this->hasFolders($user),
],
];
Expand Down

0 comments on commit b430c46

Please sign in to comment.