feat: update for Nextcloud 33 and refactor Talk integration
Channel list working, url generation, just need posting working now - Update dependency to Nextcloud 33 and add `spreed` dependency - Change webhook route from `/webhook` to `/bot-webhook` - Add `NavigationProvider` to add app to admin settings menu - Refactor `TalkService` to query Talk DB directly for room listing (public channels) - Update `postToRoom` to use Talk Chat API with Basic Auth for `talk-bot` user - Add debug helper methods to `TalkService` for room debugging - Enhance `debug` endpoint with detailed system and Talk configuration info - Update admin settings UI with "Default Sender Name" field and improved room selection - Add localization strings to admin settings - Update documentation (`INSTALL.md`, `README.md`) for new route and bot admin requirement - Improve `getBaseUrl` logic to prioritize `trusted_domains` for Docker compatibility
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\NCdiscordhook;
|
||||
|
||||
use OCP\IConfig;
|
||||
use OCP\IL10N;
|
||||
use OCP\IURLGenerator;
|
||||
use OCP\IUserSession;
|
||||
use OCP\Navigation\INavigationProvider;
|
||||
|
||||
class NavigationProvider implements INavigationProvider {
|
||||
public function __construct(
|
||||
private readonly IURLGenerator $urlGenerator,
|
||||
private readonly IUserSession $userSession,
|
||||
private readonly IConfig $config,
|
||||
private readonly IL10N $l10n,
|
||||
) {}
|
||||
|
||||
public function getNavigation(): array {
|
||||
$user = $this->userSession->getUser();
|
||||
if ($user === null || !$user->isAdmin()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return [
|
||||
[
|
||||
'id' => 'ncdiscordhook',
|
||||
'app_id' => 'ncdiscordhook',
|
||||
'type' => 'settings',
|
||||
'name' => $this->l10n->t('NCdiscordhook'),
|
||||
'href' => $this->urlGenerator->linkToRoute('settings.AdminSettings#index'),
|
||||
'icon' => $this->urlGenerator->imagePath('ncdiscordhook', 'app.svg'),
|
||||
'order' => 0,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user