Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-10 15:34:53 +0300
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-06-10 18:13:06 +0300
commit2e6d6600c42ff206b7fa6b71828589588b20d14f (patch)
treefc869cfc696e81979eed06258d77111e5a5556eb /lib
parent06fdd1dab7b6622e5500245d377049015278452c (diff)
Reset attachment folder when it cannot be created
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/TInitialState.php11
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 {