We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 23e7f50 commit bc7bcd7Copy full SHA for bc7bcd7
1 file changed
src/MTProto/NewAuthKey.php
@@ -54,7 +54,6 @@ public function __construct(
54
Publisher $loginState,
55
private readonly ?self $mainKey = null
56
) {
57
- ;
58
$this->connectionState = new Publisher(
59
$isCdn
60
? ConnectionState::UNENCRYPTED
@@ -73,9 +72,10 @@ public function __construct(
73
72
public function onSimpleStateChange($state): void
74
{
75
if ($state instanceof ConnectionState) {
+ $state = $this->mainKey->connectionState->getState();
76
+
77
if ($this->connectionState->getState() === ConnectionState::UNENCRYPTED_MEDIA_WAITING_MAIN) {
- if ($state === ConnectionState::ENCRYPTED_NOT_BOUND) {
78
- Assert::notNull($this->mainKey);
+ if ($state->isEncrypted()) {
79
$this->setAuthKey($this->mainKey->authKey);
80
}
81
} else {
0 commit comments