diff --git a/lib/Settings/Admin/AdminSettings.php b/lib/Settings/Admin/AdminSettings.php index 396d5ca3cfe..02a0ad76fa9 100644 --- a/lib/Settings/Admin/AdminSettings.php +++ b/lib/Settings/Admin/AdminSettings.php @@ -105,6 +105,7 @@ public function getForm(): TemplateResponse { } protected function initGeneralSettings(): void { + $this->initialState->provideInitialState('ask_guest_username', (int) $this->serverConfig->getAppValue('spreed', 'ask_guest_username', '0')); $this->initialState->provideInitialState('default_group_notification', (int) $this->serverConfig->getAppValue('spreed', 'default_group_notification', Participant::NOTIFY_MENTION)); $this->initialState->provideInitialState('conversations_files', (int) $this->serverConfig->getAppValue('spreed', 'conversations_files', '1')); $this->initialState->provideInitialState('conversations_files_public_shares', (int) $this->serverConfig->getAppValue('spreed', 'conversations_files_public_shares', '1')); diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 4ad6750ee01..6575a796e09 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -72,6 +72,11 @@ protected function publishInitialStateShared(): void { 'sip_dialin_info', $this->talkConfig->getDialInInfo() ); + + $this->initialState->provideInitialState( + 'ask_guest_username', + (int) $this->serverConfig->getAppValue('spreed', 'ask_guest_username', '0') + ); } protected function publishInitialStateForUser(IUser $user, IRootFolder $rootFolder, IAppManager $appManager): void { diff --git a/src/components/AdminSettings/GeneralSettings.vue b/src/components/AdminSettings/GeneralSettings.vue index 088176fdfa0..0b6b13705ee 100644 --- a/src/components/AdminSettings/GeneralSettings.vue +++ b/src/components/AdminSettings/GeneralSettings.vue @@ -24,6 +24,20 @@

{{ t('spreed', 'General settings') }}

+

+ + +

+

+ {{ t('spreed', 'If guest have no display name, nextcloud will ask it on guest joining to conversation') }} +

+

{{ t('spreed', 'Default notification settings') }}

@@ -83,9 +97,11 @@ export default { data() { return { loading: true, + loadingAskGuestUsername: false, loadingConversationsFiles: false, loadingDefaultGroupNotification: false, + askGuestUsername: false, defaultGroupNotificationOptions, defaultGroupNotification: defaultGroupNotificationOptions[1], @@ -96,6 +112,7 @@ export default { mounted() { this.loading = true + this.askGuestUsername = parseInt(loadState('spreed', 'ask_guest_username')) === 1 this.conversationsFiles = parseInt(loadState('spreed', 'conversations_files')) === 1 this.defaultGroupNotification = defaultGroupNotificationOptions[parseInt(loadState('spreed', 'default_group_notification')) - 1] this.conversationsFilesPublicShares = parseInt(loadState('spreed', 'conversations_files_public_shares')) === 1 @@ -103,6 +120,15 @@ export default { }, methods: { + saveAskGuestUsername() { + this.loadingAskGuestUsername = true + + OCP.AppConfig.setValue('spreed', 'ask_guest_username', this.askGuestUsername ? '1' : '0', { + success: function() { + this.loadingAskGuestUsername = false + }.bind(this), + }) + }, saveDefaultGroupNotification() { this.loadingDefaultGroupNotification = true diff --git a/src/components/SetGuestUsername.vue b/src/components/SetGuestUsername.vue index ae41f3fbb71..46a4540b131 100644 --- a/src/components/SetGuestUsername.vue +++ b/src/components/SetGuestUsername.vue @@ -21,48 +21,79 @@