Skip to content

Commit

Permalink
fix: don't show Talk link when app is not enabled
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: janepie <49834966+janepie@users.noreply.github.com>
Signed-off-by: Jana Peper <jana.peper@nextcloud.com>
  • Loading branch information
janepie and julien-nc committed Mar 4, 2025
1 parent dfbca6f commit 34ffc1a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions lib/Service/FileService.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Exception;
use OC\User\NoUserException;
use OCA\Welcome\AppInfo\Application;
use OCP\App\IAppManager;
use OCP\Files\File;
use OCP\Files\Folder;
use OCP\Files\InvalidPathException;
Expand All @@ -33,7 +34,9 @@ public function __construct(private IRootFolder $root,
private IConfig $config,
private IURLGenerator $urlGenerator,
private LoggerInterface $logger,
private IUserManager $userManager) {
private IUserManager $userManager,
private IAppManager $appManager,
) {
}

/**
Expand Down Expand Up @@ -69,9 +72,16 @@ private function getWidgetFile(): ?File {
public function getWidgetContent(): ?array {
$userName = $this->config->getAppValue(Application::APP_ID, 'userName');
$userId = $this->config->getAppValue(Application::APP_ID, 'userId');
$supportUserName = $this->config->getAppValue(Application::APP_ID, 'supportUserName');
$supportUserId = $this->config->getAppValue(Application::APP_ID, 'supportUserId');
$supportText = $this->config->getAppValue(Application::APP_ID, 'supportText');
if ($this->appManager->isEnabledForUser('spreed')) {
$supportUserName = $this->config->getAppValue(Application::APP_ID, 'supportUserName');
$supportUserId = $this->config->getAppValue(Application::APP_ID, 'supportUserId');
$supportText = $this->config->getAppValue(Application::APP_ID, 'supportText');
} else {
$supportUserName = null;
$supportUserId = null;
$supportText = null;
}


$file = $this->getWidgetFile();
if ($file !== null) {
Expand Down

0 comments on commit 34ffc1a

Please sign in to comment.