diff --git a/lib/Public/ContentManager.php b/lib/Public/ContentManager.php index 76b5390..add169e 100644 --- a/lib/Public/ContentManager.php +++ b/lib/Public/ContentManager.php @@ -12,7 +12,6 @@ use OCA\ContextChat\BackgroundJobs\SubmitContentJob; use OCA\ContextChat\Db\QueueContentItem; use OCA\ContextChat\Db\QueueContentItemMapper; -use OCA\ContextChat\Event\ContentProviderRegisterEvent; use OCA\ContextChat\Logger; use OCA\ContextChat\Service\ActionScheduler; use OCA\ContextChat\Service\ProviderConfigService; @@ -91,7 +90,9 @@ public function registerContentProvider(string $appId, string $providerId, strin * @since 2.2.2 */ public function collectAllContentProviders(): void { - $providerCollectionEvent = new ContentProviderRegisterEvent($this); + $providerCollectionEvent = new \OCA\ContextChat\Event\ContentProviderRegisterEvent($this); + $this->eventDispatcher->dispatchTyped($providerCollectionEvent); + $providerCollectionEvent = new \OCP\ContextChat\Events\ContentProviderRegisterEvent($this); $this->eventDispatcher->dispatchTyped($providerCollectionEvent); } diff --git a/lib/Service/MetadataService.php b/lib/Service/MetadataService.php index 5c0dadd..745ceec 100644 --- a/lib/Service/MetadataService.php +++ b/lib/Service/MetadataService.php @@ -86,7 +86,7 @@ public function getEnrichedProviders(): array { private function getIdFromSource(string $sourceId): string { // note the ":" in the item id part - if (!preg_match('/^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+: ([a-zA-Z0-9:-])+$/', $sourceId, $matches)) { + if (!preg_match('/^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+: ([a-zA-Z0-9:-]+)$/', $sourceId, $matches)) { throw new \InvalidArgumentException("Invalid source id $sourceId"); } return $matches[1];