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:
authorGary Kim <gary@garykim.dev>2021-09-27 07:06:39 +0300
committerGary Kim <gary@garykim.dev>2021-09-27 07:06:39 +0300
commitedb51d34604bf73664c58248e6d5958428d98822 (patch)
treea95edbae7ba5d3facce9aba67b326d64fb8c67f1 /lib
parentabbe54696315d1f5b778d4cf3176a23f3a162986 (diff)
Error if federation not enabled
Signed-off-by: Gary Kim <gary@garykim.dev>
Diffstat (limited to 'lib')
-rw-r--r--lib/Controller/RoomController.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php
index 1ed4634c0..8f313db4c 100644
--- a/lib/Controller/RoomController.php
+++ b/lib/Controller/RoomController.php
@@ -36,6 +36,7 @@ use OCA\Talk\Exceptions\InvalidPasswordException;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
use OCA\Talk\Exceptions\RoomNotFoundException;
use OCA\Talk\Exceptions\UnauthorizedException;
+use OCA\Talk\Federation\FederationManager;
use OCA\Talk\GuestManager;
use OCA\Talk\Manager;
use OCA\Talk\MatterbridgeManager;
@@ -107,6 +108,8 @@ class RoomController extends AEnvironmentAwareController {
protected $config;
/** @var Config */
protected $talkConfig;
+ /** @var FederationManager */
+ protected $federationManager;
/** @var array */
protected $commonReadMessages = [];
@@ -1093,6 +1096,9 @@ class RoomController extends AEnvironmentAwareController {
return new DataResponse($data);
} elseif ($source === 'remote') {
+ if (!$this->federationManager->isEnabled()) {
+ return new DataResponse([]. Http::STATUS_BAD_REQUEST);
+ }
try {
$newUser = $this->cloudIdManager->resolveCloudId($newParticipant);
} catch (\InvalidArgumentException $e) {