mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-30 07:18:57 +01:00
Persist more state
This commit is contained in:
parent
8cc9685433
commit
8f30dad5d1
@ -75,6 +75,10 @@ final class FeedLoop extends Loop
|
||||
$this->parsedUpdates->setIteratorMode(SplQueue::IT_MODE_DELETE);
|
||||
$this->init($API);
|
||||
}
|
||||
public function __sleep()
|
||||
{
|
||||
return ['channelId', 'incomingUpdates', 'parsedUpdates', 'updater', 'state', 'API'];
|
||||
}
|
||||
/**
|
||||
* Main loop.
|
||||
*/
|
||||
|
@ -64,6 +64,10 @@ final class SeqLoop extends Loop
|
||||
$this->incomingUpdates->setIteratorMode(SplQueue::IT_MODE_DELETE);
|
||||
$this->init($API);
|
||||
}
|
||||
public function __sleep()
|
||||
{
|
||||
return ['incomingUpdates', 'feeder', 'pendingWakeups', 'state', 'API'];
|
||||
}
|
||||
/**
|
||||
* Main loop.
|
||||
*/
|
||||
|
@ -71,6 +71,10 @@ final class UpdateLoop extends Loop
|
||||
$this->init($API);
|
||||
$this->channelId = $channelId;
|
||||
}
|
||||
public function __sleep(): array
|
||||
{
|
||||
return ['channelId', 'feeder', 'API'];
|
||||
}
|
||||
private ?DeferredFuture $done = null;
|
||||
public function resumeAndWait(): void
|
||||
{
|
||||
|
@ -657,6 +657,10 @@ final class MTProto implements TLCallback, LoggerGetter, SettingsGetter
|
||||
'calls',
|
||||
'callsByPeer',
|
||||
'snitch',
|
||||
|
||||
'seqUpdater',
|
||||
'updaters',
|
||||
'feeders',
|
||||
];
|
||||
}
|
||||
|
||||
@ -1836,7 +1840,7 @@ final class MTProto implements TLCallback, LoggerGetter, SettingsGetter
|
||||
[
|
||||
'InputFileLocation' => $this->getDownloadInfo(...),
|
||||
'InputPeer' => $this->getInputPeer(...),
|
||||
'InputDialogPeer' => fn (mixed $id) => ['_' => 'inputDialogPeer', 'peer' => $this->getInputPeer($id)],
|
||||
'InputDialogPeer' => fn (mixed $id): array => ['_' => 'inputDialogPeer', 'peer' => $this->getInputPeer($id)],
|
||||
'InputCheckPasswordSRP' => fn (string $password): array => (new PasswordCalculator($this->methodCallAsyncRead('account.getPassword', [], $this->authorized_dc)))->getCheckPassword($password),
|
||||
],
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user