config->getAppValue( Application::APP_ID, 'index_context_chat_default', 'no', ); $preference = $this->preferences->getPreference( $userId, 'index-context-chat', $appConfig !== 'no' ? 'true' : 'false', ); return $preference === 'true'; } /** * Whether to index mails by default for all users that did not yet toggle the * preference themselves. */ public function isIndexingEnabledByDefault(): bool { return $this->config->getAppValue( Application::APP_ID, 'index_context_chat_default', 'no' ) !== 'no'; } /** * Enable or disable the indexing of mails for all users that did not yet toggle * the preference themselves. */ public function setIndexingEnabledByDefault(bool $enabledByDefault): void { $this->config->setAppValue( Application::APP_ID, 'index_context_chat_default', $enabledByDefault ? 'yes' : 'no', ); } }