Skip to content

Commit

Permalink
Merge pull request #44 from nextcloud/fix/SpeechToTextReferenceListen…
Browse files Browse the repository at this point in the history
…er/userId-null

Fix SpeechToTextReferenceListener: Allow userId to be null
  • Loading branch information
marcelklehr committed Feb 23, 2024
2 parents 25705fe + 1d9bd9c commit 696d048
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Listener/SpeechToText/SpeechToTextReferenceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class SpeechToTextReferenceListener implements IEventListener {
public function __construct(
private IConfig $config,
private string $userId,
private ?string $userId,
private ISpeechToTextManager $sttProcessingManager,
) {
}
Expand All @@ -47,7 +47,7 @@ public function handle(Event $event): void {
return;
}
if ($this->config->getAppValue(Application::APP_ID, 'speech_to_text_picker_enabled', '1') === '1' &&
$this->config->getUserValue($this->userId, Application::APP_ID, 'speech_to_text_picker_enabled', '1') === '1') {
($this->userId === null || $this->config->getUserValue($this->userId, Application::APP_ID, 'speech_to_text_picker_enabled', '1') === '1')) {

// Double check that atleast one provider is registered
if ($this->sttProcessingManager->hasProviders()) {
Expand Down

0 comments on commit 696d048

Please sign in to comment.