Skip to content

Commit

Permalink
Merge pull request #3794 from nextcloud/bugfix/3590/change-attachment…
Browse files Browse the repository at this point in the history
…-folder-when-it-cannot-be-created

Reset attachment folder when it cannot be created
  • Loading branch information
nickvergessen authored Jun 10, 2020
2 parents a0294ea + 5cf3b95 commit dd05346
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions lib/TInitialState.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit dd05346

Please sign in to comment.