diff options
author | Joas Schilling <coding@schilljs.com> | 2024-03-14 13:24:43 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2024-03-14 14:42:12 +0100 |
commit | e71ff6efc6ad1a58d814f4b37d75c24be9e8c57f (patch) | |
tree | a80542d8b1951577ad072d25954a474c8a98747d /lib/Controller | |
parent | c9ef4b7b847aa6d1a096842a9fcfef118d6ff607 (diff) |
fix(federation): Handle federation configs when inviting instead of generic "Can not reach remote"
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/RoomController.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index e9ba26e55..466478da3 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1089,6 +1089,7 @@ class RoomController extends AEnvironmentAwareController { } } + /** @var IUser $addedBy */ $addedBy = $this->userManager->get($this->userId); // list of participants to attempt adding, @@ -1153,7 +1154,12 @@ class RoomController extends AEnvironmentAwareController { $this->logger->error($e->getMessage(), [ 'exception' => $e, ]); - return new DataResponse([], Http::STATUS_BAD_REQUEST); + return new DataResponse(['error' => 'cloudId'], Http::STATUS_BAD_REQUEST); + } + try { + $this->federationManager->isAllowedToInvite($addedBy, $newUser); + } catch (\InvalidArgumentException $e) { + return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST); } $participantsToAdd[] = [ |