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 authored and skjnldsv committed Aug 28, 2024
1 parent f9e7f5d commit 99428f1
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 @@ -11,14 +11,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 @@ -28,6 +31,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 99428f1

Please sign in to comment.