Skip to content

Commit

Permalink
fix(middleware): Fix environmentaware controller class name
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Dec 2, 2024
1 parent 253ab7d commit 1498740
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions lib/Middleware/InjectionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace OCA\Talk\Middleware;

use OCA\Talk\Controller\AEnvironmentAwareController;
use OCA\Talk\Controller\AEnvironmentAwareOCSController;
use OCA\Talk\Exceptions\CannotReachRemoteException;
use OCA\Talk\Exceptions\ForbiddenException;
use OCA\Talk\Exceptions\ParticipantNotFoundException;
Expand Down Expand Up @@ -86,7 +86,7 @@ public function __construct(
* @throws RoomNotFoundException
*/
public function beforeController(Controller $controller, string $methodName): void {
if (!$controller instanceof AEnvironmentAwareController) {
if (!$controller instanceof AEnvironmentAwareOCSController) {
return;
}

Expand Down Expand Up @@ -173,10 +173,10 @@ protected function readSessionIdParameterFromAttributes(array $attributes): ?str
}

/**
* @param AEnvironmentAwareController $controller
* @param AEnvironmentAwareOCSController $controller
* @throws ForbiddenException
*/
protected function getRoom(AEnvironmentAwareController $controller): void {
protected function getRoom(AEnvironmentAwareOCSController $controller): void {
$token = $this->request->getParam('token');
$room = $this->manager->getRoomByToken($token);
$controller->setRoom($room);
Expand All @@ -185,11 +185,11 @@ protected function getRoom(AEnvironmentAwareController $controller): void {
}

/**
* @param AEnvironmentAwareController $controller
* @param AEnvironmentAwareOCSController $controller
* @param bool $moderatorRequired
* @throws NotAModeratorException
*/
protected function getLoggedIn(AEnvironmentAwareController $controller, bool $moderatorRequired): void {
protected function getLoggedIn(AEnvironmentAwareOCSController $controller, bool $moderatorRequired): void {
$token = $this->request->getParam('token');
$sessionId = $this->talkSession->getSessionForRoom($token);
$room = $this->manager->getRoomForUserByToken($token, $this->userId, $sessionId);
Expand All @@ -206,14 +206,14 @@ protected function getLoggedIn(AEnvironmentAwareController $controller, bool $mo
}

/**
* @param AEnvironmentAwareController $controller
* @param AEnvironmentAwareOCSController $controller
* @param bool $moderatorRequired
* @param bool $requireListedWhenNoParticipant
* @throws NotAModeratorException
* @throws ParticipantNotFoundException
*/
protected function getLoggedInOrGuest(
AEnvironmentAwareController $controller,
AEnvironmentAwareOCSController $controller,
bool $moderatorRequired,
bool $requireListedWhenNoParticipant = false,
bool $requireFederationWhenNotLoggedIn = false,
Expand Down Expand Up @@ -281,11 +281,11 @@ protected function getLoggedInOrGuest(
}

/**
* @param AEnvironmentAwareController $controller
* @param AEnvironmentAwareOCSController $controller
* @throws RoomNotFoundException
* @throws ParticipantNotFoundException
*/
protected function getRoomByInvite(AEnvironmentAwareController $controller): void {
protected function getRoomByInvite(AEnvironmentAwareOCSController $controller): void {
if ($this->userId === null) {
throw new ParticipantNotFoundException('No user available');
}
Expand All @@ -309,21 +309,21 @@ protected function getRoomByInvite(AEnvironmentAwareController $controller): voi
}

/**
* @param AEnvironmentAwareController $controller
* @param AEnvironmentAwareOCSController $controller
* @throws FederationUnsupportedFeatureException
*/
protected function checkFederationSupport(AEnvironmentAwareController $controller): void {
protected function checkFederationSupport(AEnvironmentAwareOCSController $controller): void {
$room = $controller->getRoom();
if ($room instanceof Room && $room->isFederatedConversation()) {
throw new FederationUnsupportedFeatureException();
}
}

/**
* @param AEnvironmentAwareController $controller
* @param AEnvironmentAwareOCSController $controller
* @throws ReadOnlyException
*/
protected function checkReadOnlyState(AEnvironmentAwareController $controller): void {
protected function checkReadOnlyState(AEnvironmentAwareOCSController $controller): void {
$room = $controller->getRoom();
if (!$room instanceof Room || $room->getReadOnly() === Room::READ_ONLY) {
throw new ReadOnlyException();
Expand All @@ -336,7 +336,7 @@ protected function checkReadOnlyState(AEnvironmentAwareController $controller):
/**
* @throws PermissionsException
*/
protected function checkPermission(AEnvironmentAwareController $controller, string $permission): void {
protected function checkPermission(AEnvironmentAwareOCSController $controller, string $permission): void {
$participant = $controller->getParticipant();
if (!$participant instanceof Participant) {
throw new PermissionsException();
Expand All @@ -353,7 +353,7 @@ protected function checkPermission(AEnvironmentAwareController $controller, stri
/**
* @throws LobbyException
*/
protected function checkLobbyState(AEnvironmentAwareController $controller): void {
protected function checkLobbyState(AEnvironmentAwareOCSController $controller): void {
try {
$this->getLoggedInOrGuest($controller, true);
return;
Expand Down

0 comments on commit 1498740

Please sign in to comment.