diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 4482ce893ba..d30f89da47b 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -83,10 +83,6 @@ protected function publishInitialStateForUser(IUser $user, IRootFolder $rootFold ); $attachmentFolder = $this->talkConfig->getAttachmentFolder($user->getUID()); - $this->initialStateService->provideInitialState( - 'talk', 'attachment_folder', - $attachmentFolder - ); if ($attachmentFolder) { try { @@ -96,9 +92,16 @@ protected function publishInitialStateForUser(IUser $user, IRootFolder $rootFold $userFolder->newFolder($attachmentFolder); } } catch (NotPermittedException $e) { + $attachmentFolder = '/'; + $this->serverConfig->setUserValue($user->getUID(), 'spreed', 'attachment_folder', '/'); } catch (NoUserException $e) { } } + + $this->initialStateService->provideInitialState( + 'talk', 'attachment_folder', + $attachmentFolder + ); } protected function publishInitialStateForGuest(): void {