Huge bugfix

This commit is contained in:
Daniil Gentili 2017-05-01 21:45:04 +02:00
parent 6280123828
commit 62b72f190e
2 changed files with 3 additions and 1 deletions

View File

@ -24,6 +24,7 @@ trait PeerHandler
public function add_users($users)
{
foreach ($users as $key => $user) {
if (!isset($user['access_hash'])) continue;
switch ($user['_']) {
case 'user':
if (!isset($this->chats[$user['id']]) || $this->chats[$user['id']] !== $user) {
@ -49,6 +50,7 @@ trait PeerHandler
public function add_chats($chats)
{
foreach ($chats as $key => $chat) {
if (!isset($chat['access_hash'])) continue;
switch ($chat['_']) {
case 'chat':
case 'chatEmpty':

View File

@ -372,13 +372,13 @@ trait ResponseHandler
if (!$this->settings['updates']['handle_updates']) {
return;
}
\danog\MadelineProto\Logger::log(['Parsing updates received via the socket...'], \danog\MadelineProto\Logger::VERBOSE);
if ($this->getting_state) {
\danog\MadelineProto\Logger::log(['Getting state, handle later'], \danog\MadelineProto\Logger::VERBOSE);
$this->pending_updates[] = $updates;
return false;
}
\danog\MadelineProto\Logger::log(['Parsing updates received via the socket...'], \danog\MadelineProto\Logger::VERBOSE);
$opts = [];
foreach (['date', 'seq', 'seq_start'] as $key) {
if (isset($updates[$key])) {