1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 07:34:41 +01:00
This commit is contained in:
Daniil Gentili 2021-04-18 05:34:32 -07:00
parent f0e70b0e54
commit a158d94dbd
3 changed files with 6 additions and 4 deletions

View File

@ -92,8 +92,9 @@ class API extends InternalDoc
* Session paths.
*
* @internal
* @var SessionPaths
*/
public SessionPaths $session;
public $session;
/**
* Instance of MadelineProto.
@ -343,7 +344,7 @@ class API extends InternalDoc
if ($this->unlock) {
($this->unlock)();
}
} else {
} else if ($this->logger) {
$this->logger->logger('Shutting down MadelineProto (old deserialized instance of API)');
}
}

View File

@ -285,7 +285,7 @@ class VoIP
*/
public function discard($reason = ['_' => 'phoneCallDiscardReasonDisconnect'], $rating = [], $debug = false)
{
if ($this->callState === self::CALL_STATE_ENDED || empty($this->configuration)) {
if (($this->callState ?? self::CALL_STATE_ENDED) === self::CALL_STATE_ENDED || empty($this->configuration)) {
return false;
}
$this->callState = self::CALL_STATE_ENDED;
@ -606,7 +606,7 @@ class VoIP
*/
public function getCallState(): int
{
return $this->callState;
return $this->callState ?? self::CALL_STATE_ENDED;
}
/**

View File

@ -324,6 +324,7 @@ trait AuthKeyHandler
if ($controller->getCallState() === \danog\MadelineProto\VoIP::CALL_STATE_ENDED) {
$this->logger("Discarding ended call...");
$controller->discard();
unset($this->calls[$id]);
}
});
}