diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-10 15:34:53 +0300 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2020-06-10 15:34:53 +0300 |
commit | 5cf3b955e6212f0c4895e76b0a740c72c23720eb (patch) | |
tree | 623c872c89fd116dd80b26cb7453bc053dde41e2 /lib/TInitialState.php | |
parent | a0294ea87e6bad85ff31f1425d5fc4b05a8f55ae (diff) |
Reset attachment folder when it cannot be created
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/TInitialState.php')
-rw-r--r-- | lib/TInitialState.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/TInitialState.php b/lib/TInitialState.php index 4482ce893..d30f89da4 100644 --- a/lib/TInitialState.php +++ b/lib/TInitialState.php @@ -83,10 +83,6 @@ trait TInitialState { ); $attachmentFolder = $this->talkConfig->getAttachmentFolder($user->getUID()); - $this->initialStateService->provideInitialState( - 'talk', 'attachment_folder', - $attachmentFolder - ); if ($attachmentFolder) { try { @@ -96,9 +92,16 @@ trait TInitialState { $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 { |