mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-27 07:34:41 +01:00
BC fixes
This commit is contained in:
parent
f0e70b0e54
commit
a158d94dbd
@ -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)');
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user