Skip to content

Commit bc7bcd7

Browse files
committed
Bugfix
1 parent 23e7f50 commit bc7bcd7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/MTProto/NewAuthKey.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ public function __construct(
5454
Publisher $loginState,
5555
private readonly ?self $mainKey = null
5656
) {
57-
;
5857
$this->connectionState = new Publisher(
5958
$isCdn
6059
? ConnectionState::UNENCRYPTED
@@ -73,9 +72,10 @@ public function __construct(
7372
public function onSimpleStateChange($state): void
7473
{
7574
if ($state instanceof ConnectionState) {
75+
$state = $this->mainKey->connectionState->getState();
76+
7677
if ($this->connectionState->getState() === ConnectionState::UNENCRYPTED_MEDIA_WAITING_MAIN) {
77-
if ($state === ConnectionState::ENCRYPTED_NOT_BOUND) {
78-
Assert::notNull($this->mainKey);
78+
if ($state->isEncrypted()) {
7979
$this->setAuthKey($this->mainKey->authKey);
8080
}
8181
} else {

0 commit comments

Comments
 (0)