From 48406c31f9f8818c0e6ead1cefd49d450dba5683 Mon Sep 17 00:00:00 2001 From: Edward Ly Date: Fri, 11 Jul 2025 08:26:00 -0700 Subject: [PATCH] feat(ContextChat): add isContextChatAvailable method to OCP API Signed-off-by: Edward Ly --- lib/private/ContextChat/ContentManager.php | 4 ++++ lib/public/ContextChat/IContentManager.php | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/private/ContextChat/ContentManager.php b/lib/private/ContextChat/ContentManager.php index 2185829a633..eae017b462d 100644 --- a/lib/private/ContextChat/ContentManager.php +++ b/lib/private/ContextChat/ContentManager.php @@ -16,6 +16,10 @@ class ContentManager implements IContentManager { ) { } + public function isContextChatAvailable(): bool { + return $this->contentManager !== null; + } + public function registerContentProvider(string $appId, string $providerId, string $providerClass): void { $this->contentManager?->registerContentProvider($appId, $providerId, $providerClass); } diff --git a/lib/public/ContextChat/IContentManager.php b/lib/public/ContextChat/IContentManager.php index b6a81892e15..34682b3329a 100644 --- a/lib/public/ContextChat/IContentManager.php +++ b/lib/public/ContextChat/IContentManager.php @@ -11,6 +11,14 @@ namespace OCP\ContextChat; * @since 32.0.0 */ interface IContentManager { + /** + * Checks if the context chat app is enabled or not + * + * @return bool + * @since 32.0.0 + */ + public function isContextChatAvailable(): bool; + /** * @param string $appId * @param string $providerId