Skip to content

Commit

Permalink
fixup! fixup! feat(API): Allow to block older clients
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen committed May 31, 2023
1 parent 2db42dd commit 6183be4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/Middleware/CanUseTalkMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
use OCP\AppFramework\OCSController;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IL10N;
use OCP\IRequest;
use OCP\IUser;
use OCP\IUserSession;
Expand Down Expand Up @@ -74,7 +73,6 @@ public function __construct(
protected Config $talkConfig,
protected IConfig $serverConfig,
protected IRequest $request,
protected IL10N $l,
) {
}

Expand Down Expand Up @@ -128,10 +126,7 @@ public function beforeController(Controller $controller, string $methodName): vo
public function afterException($controller, $methodName, \Exception $exception): Response {
if ($exception instanceof UnsupportedClientVersionException) {
if ($controller instanceof OCSController) {
throw new OCSException(
$this->l->t('Unsupported client version. The minimum required version is %s', $exception->getMinVersion()),
Http::STATUS_UPGRADE_REQUIRED
);
throw new OCSException($exception->getMinVersion(), Http::STATUS_UPGRADE_REQUIRED);
}

return new RedirectToDefaultAppResponse();
Expand Down

0 comments on commit 6183be4

Please sign in to comment.