1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-23 10:31:13 +01:00

ForceFull on startAndLoop

This commit is contained in:
Daniil Gentili 2021-04-08 00:31:48 +02:00
parent 2a5f79e073
commit a779c75826
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -140,6 +140,13 @@ class API extends InternalDoc
*/
private bool $destructing = false;
/**
* Whether we need a full instance.
*
* @var boolean
*/
private bool $forceFull = false;
/**
* API wrapper (to avoid circular references).
*
@ -249,9 +256,9 @@ class API extends InternalDoc
protected function connectToMadelineProto(SettingsAbstract $settings, bool $forceFull = false): \Generator
{
if ($settings instanceof SettingsIpc) {
$forceFull = $forceFull || $settings->getSlow();
$forceFull = $forceFull || $this->forceFull || $settings->getSlow();
} elseif ($settings instanceof Settings) {
$forceFull = $forceFull || $settings->getIpc()->getSlow();
$forceFull = $forceFull || $this->forceFull || $settings->getIpc()->getSlow();
}
[$unserialized, $this->unlock] = yield Tools::timeoutWithDefault(
@ -416,6 +423,7 @@ class API extends InternalDoc
{
$errors = [];
$this->async(true);
$this->forceFull = true;
if (!yield from $this->reconnectFull()) {
return;