Bugfixes
This commit is contained in:
parent
bd40ca528a
commit
d8d727d68a
@ -47,6 +47,7 @@ class API extends APIFactory
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
$this->API->reset_session(false);
|
||||
return ['API'];
|
||||
}
|
||||
|
||||
|
@ -232,12 +232,14 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB
|
||||
//}
|
||||
}
|
||||
|
||||
public function reset_session()
|
||||
public function reset_session($de = true)
|
||||
{
|
||||
foreach ($this->datacenter->sockets as $id => &$socket) {
|
||||
\danog\MadelineProto\Logger::log('Resetting session id and seq_no in DC '.$id.'...');
|
||||
$socket->session_id = \danog\MadelineProto\Tools::random(8);
|
||||
$socket->seq_no = 0;
|
||||
if ($de) {
|
||||
\danog\MadelineProto\Logger::log('Resetting session id and seq_no in DC '.$id.'...');
|
||||
$socket->session_id = \danog\MadelineProto\Tools::random(8);
|
||||
$socket->seq_no = 0;
|
||||
}
|
||||
$socket->incoming_messages = [];
|
||||
$socket->outgoing_messages = [];
|
||||
$socket->new_outgoing = [];
|
||||
|
Loading…
Reference in New Issue
Block a user