Skip to content

Commit e0dd2ba

Browse files
committed
Remove unnecessary request
1 parent 6338b82 commit e0dd2ba

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

app/Controller.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,9 @@ private function generateResponse(Client $client, Request $request): self
233233
],
234234
];
235235

236-
$info = $client->getInfo($this->request['peer']);
237-
238236
if (
239-
!in_array($info->type, ['channel', 'supergroup']) &&
240-
Config::getInstance()->get('access.only_public_channels')
237+
Config::getInstance()->get('access.only_public_channels') &&
238+
!in_array($client->getInfo($this->request['peer'])->type, ['channel', 'supergroup'])
241239
) {
242240
throw new UnexpectedValueException('This is not a public channel', 403);
243241
}

0 commit comments

Comments
 (0)